LDOM: Faster deployment of Guest domains using dd Print E-mail
(1 vote, average: 5.00 out of 5)
Written by geekyS   
Monday, 08 December 2008 17:38

Sun Virtualization  - Logical Domain Manager(LDOM) 

Following procedure explains the steps for faster deployment of LDOM guest domains by copying root disk of a running machine,

1)Create dd out of base machine root disk

#dd if=/dev/rdsk/c0t0d0s0 of=/tmp/guest.img bs=8192k

 

Provide your root disk rdsk device path in place of /dev/rdsk/c0t0d0s0

2) Mount guest image file(/tmp/guest.img) created

#lofiadm -a guest.img
#mount /dev/lofi/1 /mnt

3) Update the guest domain configuration in the created image

#cd /mnt/etc
#rm defaultdomain
#rm hostname.*

-Create and update /mnt/etc/hostname.vnet0
-Update /mnt/etc/nodename file with the guest domain hostname

 

4)Modify vfstab 

  - remove any mounts relevant to the base host from which image was created
  - replace base host root mount as below   

   replace
 /dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      -
  with
  /dev/dsk/c0d0s0       /dev/rdsk/c0d0s0      /       ufs     1       no      -

5) Remove the device files in the image
 

#rm /mnt/dev/dsk/*
#rm /mnt/dev/rdsk/*

6) Create device links for disk0 which will represent guest image file(/tmp/guest.img)


#cd /mnt/dev/dsk
#ln -s
../../devices/virtual-devices@100/channel-devices@200/disk@0:a c0d0s0
#cd /mnt/dev/rdsk
#ln -s
../../devices/virtual-devices@100/channel-devices@200/disk@0:a,raw c0d0s0

7) Touch reconfigure file for automatic configuration during bootup
 

#touch /mnt/reconfigure

8) umount the image
 

# cd / ; umount /mnt
# lofiadm -d /dev/lofi/1

9) Configure LDOM Guest domain( not the scope of this document )

#ldm add-domain guestdom
#ldm add-vcpu guestdom
#ldm add-memory guestdom
#ldm add-vnet vnet1 primary-vsw0 guestdom
#ldm add-vdsdev  /tmp/guest.img 
vol1@primary-vds0
#ldm add-vdisk vdisk vol1@primary-vds0 guestdom
#ldm bind guestdom
#ldm start-domain guestdom

 

Last Updated on Thursday, 01 January 2009 09:23