Caution - Only perform Steps 3-6 of this procedure from the console of the special-purpose logical domain that will be the source of the golden OS image. This process removes the domain's network configuration and thus isolates it from the network and interrupts any session that relies on a direct network connection to this domain. |
See How to Create and Start a Guest Domain in Oracle VM Server for SPARC 3.4 Administration Guide.
nova# ldm add-vdsdev options=ro,slice /path-to-iso/simple-init-1.0.iso \ simple-init@primary-vds0 nova# ldm add-vdisk simple-init simple-init@primary-vds0 your-new-ldom
golden# mount -F hsfs /dev/dsk/c1d1s0 /mnt # or use c0d1s0 if Solaris 10
golden# mount -L simple-init /mnt
This package mounts the config drive at boot and executes the driver's initialization instructions provided on the ConfigDrive by means of a payload file.
golden# cd /mnt; ./setup
golden# ipadm delete-ip net0 golden# netadm enable -p ncp DefaultFixed golden# rm /etc/defaultrouter golden# route -p flush golden# rm /etc/ssh/ssh_host_* golden# nscfg unconfig svc:/network/dns/client:default golden# svcadm refresh svc:/network/dns/client:default golden# rm -f /etc/resolv.conf golden# svcadm disable svc:/network/dns/client:default golden# svccfg -s system/identity:node setprop config/nodename="openstack-build" golden# svccfg -s system/identity:node refresh
golden# rm /etc/hostname.* /etc/dhcp.* golden# rm /etc/defaultrouter /etc/resolv.conf golden# route -p flush golden# rm /etc/ssh/ssh_host_* golden# echo "openstack-build" > /etc/nodename
golden# rm -f /etc/sysconfig/network-scripts/ifcfg-eth* golden# rm -f /etc/sysconfig/network-scripts/route-eth* golden# rm -f /etc/resolv.conf golden# rm -f /etc/ssh/ssh_host_* golden# rm -f /etc/udev/rules.d/70-persistent-net.rules golden# echo "HOSTNAME=openstack-build" > /etc/sysconfig/network
golden# shutdown -i5 -g0 -y
golden# shutdown -h now
For example, the disk volume is myldom-vol10.
nova# ldm list -o disk primary | grep myldom-vol0 myldom-vol0 /dev/zvol/dsk/ldompool/myldom-vol0
Even if the guest domain backend volume is a block device (/dev/dsk), the gdd command requires the corresponding character device (/dev/rdsk) for the image capture. Also use the appropriate whole disk device link that ends in dNs2 (slice 2) for devices that have a VTOC label, and dN (the disk number) for devices that have an EFI label.
For example, the myldom-vol10 disk volume is the input file and the output file is the sol11_3s12_simp-init.img image.
nova# gdd if=/dev/zvol/rdsk/ldompool/myldom-vol0 of=sol11_3s12_simp-init.img \ bs=1048576 oflag=nocache conv=sparse