How to migrate ldom from one server to another

How to migrate ldom from one server to another

RSY Digital World Logo

How to migrate ldom from one server to another

We are going to discuss how to migrate ldom from one server to another. We will illustrate the steps necessary to migrate ldom from one server to another. The guest ldom ldom01 will be migrated from cdom04 to cdom03.

Step by Step Procedure: how to migrate ldom from one server to another.

We are going to see step by step procedure for Migrating Logical Domains. We will be addressing many small queries related to ldom tasks during migrating logical domains.

Migrating Logical Domains

The task to be performed on Source CDOM Server

1. How to Validate the ldom status?

Verify that ldom01 exists on cdom04. Login to cdom04 and run ldm ls command.

# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.2%  0.2%  2d 9m
ldom01          active     -n----  5000    16    16G      0.1%  0.1%  1d 1h 47m

2.How to login to ldom console?

You can use telnet command to log in to ldom console from the control domain itself. Login to the ldom01 console and shut it down.

# telnet 0 5000
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
Connecting to console "ldom01" in group "ldom01" ....
Press ~? for control options ..
……………………………………………………
……………………………………………………
ldom01 console login
Last login: Thu Apr 30 12:59:42 on console

3. How to shutdown ldom?

There is many ways how to shutdown ldom. You can directly login to ldom if it is in a functional state using putty and shutdown using commands. This is standard shutdown command in solaris which will place server to OK prompt. You can shutdown using init command. Also, ldom can be abruptly shutdown using ldm stop command from the control domain. 

How to stop and start ldom in solaris?

# ldm stop <ldom01>                >>>ldomname you can get from ldm list command.
# ldm stop-domain ldom01     >>>ldomname you can get from ldm list command.
# ldm start <ldom01>             >>>ldomname you can get from ldm list command.

How to shutdown ldom continues….

# shutdown -y -g0 -i0
# init 0
svc.startd: The system is coming down.  Please wait.
svc.startd: 108 system services are now being stopped.
NOTICE: iwatchip_info
NOTICE: iwatchip_info
NOTICE: iwatchip_info
svc.startd: The system is down.
syncing file systems... done
Program terminated
NOTICE: Entering OpenBoot.
NOTICE: Fetching Guest MD from HV.
NOTICE: Starting additional cpus.
NOTICE: Initializing LDC services.
NOTICE: Probing PCI devices.
NOTICE: Finished PCI probing.
SPARC T5-2, No Keyboard
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.36.2, 16.0000 GB memory available, Serial #83596181.
Ethernet address 0:14:4f:fb:93:95, Host ID: 84fb9395.
{0} ok
telnet > quit
Connection to 0 closed.

4. How to backup ldom configuration?

How to backup ldom configuration so that we can import later and make it online. ldom constraints can be exported for the migrating logical domains and transfer this file to the target host or location accessible even if ldom is down. In some cases inside the cdom and in some cases out of cdom.

# ldm list-constraints -x ldom01 > /tmp/ldom01.xml
# scp /tmp/ldom01.xml [email protected]:/var/tmp

5. How to stop ldom in solaris?

When you stop ldom in solaris it will change it,s status from active to bound.

# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.1%  0.1%  2d 14m
ldom01          active     -t----  5000    16    16G         6.2%  6.2%  4m
# ldm stop-domain ldom01
Remote graceful shutdown or reboot capability is not available on ldom01
LDom ldom01 stopped
# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.2%  0.2%  2d 15m
ldom01          bound      ------  5000    16    16G

6. How to unbind ldom?

ldm unbind or ldm unbind-domain can be used to unbind the ldom from the control domain. It will detach ldom from the control domain and ldom will go to the inactive state from bound state.

# ldm unbind-domain ldom01
# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART     16    32G      1.5%  1.5%  2d 15m
ldom01       inactive   ------                 16    16G

7. Verify the Veritas Disk Group that holds the boot disk for ldom01 guest.

# vxdisk -o alldgs list |grep ldom01
DEVICE       TYPE            DISK         GROUP        STATUS
emc_clariion0_243 auto:cdsdisk    Disk1        ldom01-dg online
# vxdg list ldom01-dg
NAME         STATE           ID
ldom01-dg enabled,cds          1430241695.35.cdom03

8. How to deport the disk group?

# vxdg deport ldom01-dg
# vxdg list |grep ldom01-dg

So we have performed all the tasks related to migrating logical domains on the source server. Now we will see what are the tasks related to migrating logical domains. Theoretically, we will be doing reverse implementations to make it live on target cdom.

Migrating Logical Domains

The task to be performed on Target CDOM Server

1.Validate ldom configuration backup

Log in to the control domain of the target system. Confirm that the constraints file is present which we have copied from Source CDOM Server. Confirm that the guest’s dg is accessible, then import it.

# ls -l /tmp/ldom01.xml
-rw-r--r--   1 root     root        6919 Apr 30 13:14 /tmp/ldom01.xml

2.Validate LDOM01 related disk group availability

# vxdisk -o alldgs list |grep ldom1
DEVICE       TYPE            DISK         GROUP        STATUS
emc_clariion0_243 auto:cdsdisk    -            (ldom01-dg) online

3. How to import disk group?

# vxdg import ldom01-dg
# vxdg list | grep ldom01-dg
NAME         STATE           ID
ldom01-dg enabled,cds          1430241695.35.cdom03
# vxdisk -o alldgs list |grep ldom01-dg
DEVICE       TYPE            DISK         GROUP        STATUS
emc_clariion0_243 auto:cdsdisk    Disk1        ldom01-dg online

4. Add LDOM using constraints file

# ldm add-domain -i /root/ldom01.xml

5. How to validate ldom status? 

Verify added ldom01 using ldm ls command. Now it will start showing if added without error. We have just added we will find it in an inactive state.

# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.3%  0.2%  2d 1h 41m
ldom01          inactive   ------          16    16G

6. How to bind the ldom?

We have to bind the ldom to bring into a bound state. We can use ldm bind-domain or ldm bind command to bind the ldom.

# ldm bind-domain ldom01

7 . How to validate the ldom status?

You can validate the ldom status using ldm ls command. It will be in a bound state now.

# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.8%  0.8%  2d 1h 41m
ldom01          bound      ------  5001    16    16G

8. How to start ldom?

So we have ldom in the bounded state now we can start ldom to take it to an active state. Please refer to below command how to start ldom using ldm start-domain or ldm start command.

# ldm start-domain ldom01        OR ldm start ldom01
LDom ldom01 started

9.Validate the ldom status

# ldm ls
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
primary          active     -n-cv-  UART    16    32G      0.4%  0.4%  2d 1h 42m
ldom01          active     -t----  5001    16    16G      8.5%  1.8%  2s

Perfect!!!

We have our ldom01 is online now on target cdom.

10. Login to ldom console and boot

# telnet 0 5001
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
Connecting to console "ldom01" in group "ldom01" ....
Press ~? for control options ..
---------------------------------
---------------------------------
---------------------------------
ldom01 console login: root
Password:
Last login: Thu Apr 30 13:08:57 on console
                                   !!! N O T I C E !!!
------------------------------
------------------------------
#

You might get ldom01 on OK prompt when you connect to the console. Boot the ldom if on OK prompt using boot command.

11.Perform ldom Validation

 Now perform routine validation to make sure functionality as earlier.

# uname -a
SunOS ldom01 5.10 Generic_147147-26 sun4v sparc sun4v
# ifconfig -a
lo0: flags=200109<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
vnet0: flags=10003<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.82.176.90 netmask fffffe00 broadcast 10.82.177.255   groupname ipmp0
ether 0:14:4f:f9:17:a
vnet0:1: flags=10043<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
# ping cdom03
cdom03 is alive
# virtinfo -a
Domain role: LDoms guest
Domain name: ldom01
Domain UUID: 9f312345-f973-418f-8fbf-bba457c86891
Control domain: cdom03
Chassis serial#: AP09271861

Above is a manual process for migrating logical domains. There is a procedure via which you can migrate online.

LDOM live migration

How to do live migration of a ldom ? 

# ldm migrate ldom01 [email protected]
How to monitor live migration of a ldom?
# ldm  list ldom01
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME 
ldom01 suspended -n---s 1 1G 0.0% 2h 7m
# ldm list -o status ldom01
NAME 
ldom01
STATUS 
OPERATION PROGRESS SOURCE 
migration 64%      ldom01
Any time you can kill process initiated by ldm migrate or even using ldm 
cancel-operation command.

That’s it about how to migrate ldom from one server to another. Migrating logical domains from one cdom to another cdom is under the same environment and on the same network. Also where ever you have to migrate that cdom must have visibility of the same storage.

I hope you like it and find it useful. If so request you to share it across your social reach as much as you can to help us to reach the maximum audience to fulfill the objective of post.

Related Posts

  1. How to Remove LDOM
  2. How to Increase File System in VXVM
  3. Solaris 11 LDOM Recovery
  4. Restoring Domain Configurations
  5. How to add vdisk from CDOM to LDOM Online

RSY Digital World

RSY Digital World Founder & [email protected] Digital World. A UNIX Linux expert having a more than 20 years of experience in Solaris Red Hat Linux HP-UX AIX Unixware Open Server Veritas Storage Cloud Bigdata and many more in UNIX LINUX Infrastructure technologies.

Leave a Reply