Many talk about virtualization nowadays, and one of real example I face would be retiring SunFire-280R (with Solaris 8) and migrating to LDom.
The problem is that the 280R is running Oracle database version 9 and I am not sure how will it work under Solaris 10 (and Oracle guys seems don't like idea of this migration exercise so no further investigation or migration has been done).
Anyway, I still had decided to test ldmp2v migration tool, and wrote this article for future references.
In short, "man ldmp2v" says:
Logical Domains Physical-to-Virtual (P2V) Migration Tool (ver 1.0) automatically converts an existing physical system to a virtual system that runs in a logical domain on a chip multithreading (CMT) system.
The source system can be any sun4u SPARC system that runs at least the Solaris 8 or a non-Logical Domains sun4v system that runs the Solaris 10.
Some prerequisites are needed before doing actual p2v migration.
The first thing it's needed is actually preparing the T2000 to host LDom.
Three services (disk service, networking and console access) have to be created and the primary control domain will provide them to the LDom.
Here I'll create two services for network, since one LDom will be on 192.168.20.x subnet and another on 192.168.28.x
{t2000}/> ldm add-vcc port-range=5000-5010 primary-consrv primary
{t2000}/> ldm add-vsw net-dev=e1000g0 primary-net0_srv primary
{t2000}/> ldm add-vsw net-dev=e1000g1 primary-net1_srv primary
{t2000}/> ldm add-vds primary_vdsksrv_cs2 primary
{t2000}/backup/bank0/var> ldm list-services
VCC
NAME LDOM PORT-RANGE
primary-consrv primary 5000-5010
VSW
NAME LDOM MAC NET-DEV DEVICE DEFAULT-VLAN-ID PVID VID MTU MODE
primary-net0_srv primary 00:14:4f:fa:24:1a e1000g0 switch@0 1 1 1500
primary-net1_srv primary 00:14:4f:fb:49:fb e1000g1 switch@1 1 1 1500
VDS
NAME LDOM VOLUME OPTIONS MPGROUP DEVICE
primary_vdsksrv_cs2 primary
|
{t2000}/> zpool status space1
pool: space1
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
space1 ONLINE 0 0 0
c0t1d0 ONLINE 0 0 0
errors: No known data errors
{t2000}/> zfs list space1
NAME USED AVAIL REFER MOUNTPOINT
space1 131K 134G 23K /space1
{t2000}/> zfs list | grep space1
space1 132K 134G 24K /space1
space1/cs2 21K 134G 21K /space1/cs2
|
{t2000}/> ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- SP 32 8064M 0.1% 3h 56m
{t2000}/> ldm list -o crypto primary
NAME
primary
MAU
ID CPUSET
0 (0, 1, 2, 3)
1 (4, 5, 6, 7)
2 (8, 9, 10, 11)
3 (12, 13, 14, 15)
4 (16, 17, 18, 19)
5 (20, 21, 22, 23)
6 (24, 25, 26, 27)
7 (28, 29, 30, 31)
|
{t2000}/> ldm set-mau 2 primary
{t2000}/> ldm set-vcpu 8 primary
{t2000}/> ldm set-memory 4G primary
{t2000}/> ldm list -o crypto primary
NAME
primary
MAU
ID CPUSET
0 (0, 1, 2, 3)
1 (4, 5, 6, 7)
{t2000}/> ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- SP 8 4G 0.0% 4h 5m
|
{t2000}/> ldm list-config
factory-default [current]
{t2000}/> ldm add-config initial
{t2000}/> ldm list-config
factory-default
initial [current]
|
{t2000}/> showmount -e t2000
export list for t2000:
/space1/p2v-images (everyone)
{t2000}/> zfs get sharenfs space1/p2v-images
NAME PROPERTY VALUE SOURCE
space1/p2v-images sharenfs rw,anon=0 local
|
# ./ldmp2v collect -d /p2v Collecting system configuration ... Archiving file systems ... DUMP: Date of this level 0 dump: Fri 05 Aug 2011 03:19:05 PM PDT DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c1t0d0s0 (cs2:/) to /p2v/ufsdump.0. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 159016 blocks (77.64MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 159010 blocks (77.64MB) on 1 volume at 5542 KB/sec DUMP: DUMP IS DONE DUMP: Date of this level 0 dump: Fri 05 Aug 2011 03:19:21 PM PDT DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c1t0d0s5 (cs2:/.0) to /p2v/ufsdump.1. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 1438 blocks (719KB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 1384 blocks (692KB) on 1 volume at 5125 KB/sec DUMP: DUMP IS DONE DUMP: Date of this level 0 dump: Fri 05 Aug 2011 03:19:23 PM PDT DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c1t0d0s6 (cs2:/backup) to /p2v/ufsdump.2. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 2206 blocks (1.08MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 2140 blocks (1.04MB) on 1 volume at 5194 KB/sec DUMP: DUMP IS DONE DUMP: Date of this level 0 dump: Fri 05 Aug 2011 03:19:27 PM PDT DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c1t0d0s3 (cs2:/usr) to /p2v/ufsdump.3. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 882080 blocks (430.70MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 881998 blocks (430.66MB) on 1 volume at 5440 KB/sec DUMP: DUMP IS DONE DUMP: Date of this level 0 dump: Fri 05 Aug 2011 03:20:50 PM PDT DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c1t0d0s4 (cs2:/var) to /p2v/ufsdump.4. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 12730 blocks (6.22MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 12724 blocks (6.21MB) on 1 volume at 3827 KB/sec DUMP: DUMP IS DONE |
# ldmp2v.conf - default parameters for LDom P2V Tools # Virtual switch to use VSW="primary-net0_srv" # Virtual disk service to use VDS="primary_vdsksrv_cs2" # Virtual console concentrator to use VCC="primary-consrv" # Location where vdisk backend devices are stored BACKEND_PREFIX="space1" # Default backend type: "zvol" or "file". BACKEND_TYPE="zvol" # Create sparse backend devices: "yes" or "no" BACKEND_SPARSE="no" # Timeout for Solaris boot in seconds BOOT_TIMEOUT=60 |
{t2000}/> ldmp2v prepare -d /space1/p2v-images/cs2 cs2
NOTICE: the size of the /usr file system will be increased to 5120 MB
Creating vdisks ...
Resizing file systems ...
Creating file systems ...
Populating file systems ...
Modifying guest OS image ...
Modifying SVM configuration ...
Unmounting file systems ...
Creating domain ...
Attaching vdisks to domain cs2 ...
|
{t2000}/> ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- SP 8 2G 0.2% 2h 18m
cs2 inactive ------ 1 1G
{t2000}/> ldm list-services
VCC
NAME LDOM PORT-RANGE
primary-consrv primary 5000-5010
VSW
NAME LDOM MAC NET-DEV DEVICE DEFAULT-VLAN-ID PVID VID MTU MODE
primary-net0_srv primary 00:14:4f:fa:24:1a e1000g0 switch@0 1 1 1500
primary-net1_srv primary 00:14:4f:fb:49:fb e1000g1 switch@1 1 1 1500
VDS
NAME LDOM VOLUME OPTIONS MPGROUP DEVICE
primary_vdsksrv_cs2 primary cs2-vol0 /dev/zvol/dsk/space1/cs2/disk0
{t2000}/> ldm list-bindings cs2
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
cs2 inactive ------ 1 1G
CONTROL
failure-policy=ignore
DEPENDENCY
master=
NETWORK
NAME SERVICE DEVICE MAC MODE PVID VID MTU
vnet0 primary-net0_srv 00:14:4f:fb:ba:c2 1
DISK
NAME VOLUME TOUT DEVICE SERVER MPGROUP
disk0 cs2-vol0@primary_vdsksrv_cs2
|
{t2000}/> ldm bind cs2
{t2000}/> ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- SP 8 2G 0.3% 2h 34m
cs2 bound ------ 5000 1 1G
{t2000}/> ldm start cs2
LDom cs2 started
{t2000}/> ldm list
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv- SP 8 2G 0.2% 2h 47m
cs2 active -t---- 5000 1 1G 100% 3s
{t2000}/> telnet localhost 5000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connecting to console "cs2" in group "cs2" ....
Press ~? for control options ..
ok printenv
Variable Name Value Default Value
ttya-rts-dtr-off false false
ttya-ignore-cd true true
keyboard-layout
reboot-command
security-mode none No default
--- truncated ---
use-nvramrc? false false
nvramrc
error-reset-recovery boot boot
ok printenv boot-device
boot-device = /virtual-devices@100/channel-devices@200/disk@0
ok boot
Sun Fire T200, No Keyboard
Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.30.4.b, 1024 MB memory available, Serial #83431980.
Ethernet address 0:14:4f:f9:12:2c, Host ID: 84f9122c.
Boot device: /virtual-devices@100/channel-devices@200/disk@0 File and args:
The file just loaded does not appear to be executable.
ok
|
{t2000}/> ldmp2v convert -i /space1/iso/sol-10-u9-ga-sparc-dvd.iso -d /space1/p2v-images/cs2 cs2
Testing original system status ...
LDom cs2 started
Waiting for Solaris to come up ...
Select 'Upgrade' (F2) when prompted for the installation type.
Disconnect from the console after the Upgrade has finished.
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
Connecting to console "cs2" in group "cs2" ....
Press ~? for control options ..
Configuring devices.
Using RPC Bootparams for network configuration information.
Attempting to configure interface vnet0...
Skipped interface vnet0
Reading ZFS config: done.
Setting up Java. Please wait...
Serial console, reverting to text install
Beginning system identification...
Searching for configuration file(s)...
Search complete.
Discovering additional network configuration...
|
-----------------------------------------------------------------
-Solaris Interactive Installation
This system is upgradable, so there are two ways to install the Solaris
software.
The Upgrade option updates the Solaris software to the new release, saving
as many modifications to the previous version of Solaris software as
possible. Back up the system before using the Upgrade option.
The Initial option overwrites the system disks with the new version of
Solaris software. This option allows you to preserve any existing file
systems. Back up any modifications made to the previous version of Solaris
software before starting the Initial option.
After you select an option and complete the tasks that follow, a summary of
your actions will be displayed.
-----------------------------------------------------------------
F2_Upgrade F3_Go Back F4_Initial F5_Exit F6_Help
|
------------------------------------------------------------------
- Profile -
The information below is your profile which shows how Solaris software will
be installed. It is a summary of the choices you've made on previous
screens.
=========================================================================
Installation Option: Upgrade
Boot Device:
Root File System Type: UFS
Upgrade Target: Solaris 9 c0d0s0
Locales: Canada-English (ISO8859-1)
U.S.A. (en_US.ISO8859-1)
System Locale: C ( C )
Software: Solaris 10, Core System Support
---------------------------------------------------------
F2_Upgrade F4_Change F5_Exit F6_Help
|
----------------------------------------------------
- Upgrading Solaris Software - Progress
The Solaris software is now being upgraded on the system using the profile
you created. Upgrading Solaris software can take up to 2 hours (may be
longer on servers) depending on the software you've selected, the
reallocation of any space if needed, and the speed of the network or local
CD-ROM.
When Solaris software is completely upgraded, the message `Upgrade complete'
will be displayed.
Removing obsolete files in package: |
Sun Fire T200, No Keyboard
Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.30.4.b, 1024 MB memory available, Serial #83431980.
Ethernet address 0:14:4f:f9:12:2c, Host ID: 84f9122c.
Boot device: disk0 File and args:
SunOS Release 5.10 Version Generic_142909-17 64-bit
Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
Hostname: cs2
Configuring devices.
Loading smf(5) service descriptions: 135/135
Reading ZFS config: done.
What type of terminal are you using?
1) ANSI Standard CRT
2) DEC VT52
3) DEC VT100
4) Heathkit 19
5) Lear Siegler ADM31
6) PC Console
7) Sun Command Tool
8) Sun Workstation
9) Televideo 910
10) Televideo 925
11) Wyse Model 50
12) X Terminal Emulator (xterms)
13) CDE Terminal Emulator (dtterm)
14) Other
Type the number of your choice and press Return: 3
- Configure Keyboard Layout -
Please specify the keyboard layout from the list below.
-To make a selection, use the arrow keys to highlight the option and
press Return to mark it [X].
Keyboard Layout
-------------------------
[ ] Slovak
[ ] Srpski
[ ] Spanish
[ ] Swedish
[ ] Swiss-French
[ ] Swiss-German
[ ] Taiwanese
[ ] UK-English
[X] US-English
------------------------------------
Esc-2_Continue Esc-6_Help
|