Go to main content
Oracle® VM Server for SPARC OpenStack Nova Driver and Utilities 1.0 Administration Guide

Exit Print View

Updated: May 2017
 
 

How to Create a Golden OS Image for Glance


Caution

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.


  1. Create a guest domain that uses only a single network interface such as net0, vnet0, or eth0. The network interface must have a static IP configuration.

    See How to Create and Start a Guest Domain in Oracle VM Server for SPARC 3.4 Administration Guide.

  2. Attach the simple-init ISO image to your guest domain.
    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
  3. Mount the image in the guest domain.
    • Oracle Solaris OS:
      golden# mount -F hsfs /dev/dsk/c1d1s0 /mnt    # or use c0d1s0 if Solaris 10
    • Linux for SPARC 1.0:
      golden# mount -L simple-init /mnt
  4. Install the guest package.

    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
  5. Remove the existing unique configuration from the special-purpose, logical domain that will be the source of a golden OS image.
    • Oracle Solaris 11:
      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
    • Oracle Solaris 10:
      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
    • Linux for SPARC 1.0:
      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
  6. Perform a clean shutdown of the guest domain.
    • Oracle Solaris OS:
      golden# shutdown -i5 -g0 -y
    • Linux for SPARC 1.0:
      golden# shutdown -h now
  7. Find the guest domain disk's back end volume.

    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
  8. Capture the disk image to a file.

    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