Quick and easy way to setup Guest Logical Domains using ZFS clone.
By Roman Ivanov-Oracle on Oct 20, 2008
Question: I want to install more than one guest domain. Is there any way to speedup process.
Answer: Yes, sure.
This instruction can be used as supplimental to «Run your first Logical Domain in 10 minutes» as well as a separate guide.
First setup the Control Domain and install the First Guest Domain ldg1. Use ZFS volume (In example, data/demo/ldg1) as back end drive for the system drive of guest domain. You can install Solaris either through a Network Install or by mounting a DVD or ISO file.
Log in to the First guest domain Console and do 'sys-unconfig' in the domain.
Wait for the system to come down and answer h — halt.
From Control domain verify that guest domain ldg1 is stopped.
Create a ZFS snapshot of the First Guest Domain's disk image:
Bind and Start domain back
Clone the snapshot using the name ldg2 as the target volume
Setup 2 nd Guest domain by using newly created ZFS clone data/demo/ldg2 as back-end to system disk.
Repeat steps 8 and 9 for each next domain.
# sys-unconfig WARNING This program will unconfigure your system. It will cause it to revert to a "blank" system - it will not have a name or know about other systems or networks. This program will also halt the system. Do you want to continue (y/n) ? y
svc.startd: The system is down.
syncing file systems... done
r)eboot, o)k prompt, h)alt? h
# ldm ls
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
primary active -n-cv SP 4 4G 0.5% 1h 30m
ldg1 bound ----- 5000 14 1984M
# ldm unbind ldg1
# zfs snapshot data/demo/ldg1@install
# ldm bind ldg1 # ldm start ldg1
# zfs clone data/demo/ldg1@install data/demo/ldg2