VM Distribution Procedure
From MyWiki
This page describes the step necessary to distribute or clone a virtual machine to external entities.
Contents |
Clone the Virtual Machine
- Shutdown the "source" VM using the VMware Server Console. This is the one to be distributed.
- Copy all VM files from /var/lib/vmware/Virtual Machines/SourceVMInstance to a new location.
- Boot the source VM back up if desired. This is the last we will touch the source VM.
Boot the Target VM
- Log onto NetEng and register the VM hostname. Use C00000 as the asset number.
- In the VMware Server Console, log onto the physical server, then use the Open Existing Virtual Machine button, Browse button, change to the new directory containing the copied files, thens select the Other Linux 2.6.x kernel.vmx file. Click Start this virtual machine and click the Ok button on the Create UUID dialog. Click in the starting VMWare window so your keystrokes are captured by it. Hit Ctrl+Alt+Insert to reboot the VM if you are too slow to get to single user mode (see the next step.) Also, in the Inventory list, right click the new VM entry to rename it.
- Configure the target VM to boot single user without networking; just after starting the VM, hit the Enter key on the grub target, then e. Append single or 1 to the end of the the root (hd0,0) line, then Enter, then b (boot). Log in at the prompt.
- Edit the /etc/sysconfig/network, /etc/sysconfig/networks/ifcfg-eth1, /etc/hosts files. Consult Private_Network for details on the last two files. To activate the new VM's static DNS entry, use elinks http:neteng then go to the NCSA Host/Audit/DNS Requests, then to the Network Activation link. Reboot.
Sanitize the Target VM
This section is only necessary if you are not doing a development clone.
- Change the root password to the name of the server
- Delete user accounts and home directories
- Change ownership of files owned by obsolete users (preferably in original VM too, to simplify future releases)
- Sanitize logs (specifics?)
- Sanitize SSH
- Delete the following files from /etc
- ssh_host_dsa_key
- ssh_host_dsa_key.pub
- ssh_host_key
- ssh_host_key.pub
- ssh_host_rsa_key
- ssh_host_rsa_key.pub
- Delete the following files from /etc
- Delete the following from /etc/grid-security
- container*.pem
- host*.pem
- To make sure the ntpd daemon keeps accurate time, delete the ntpd drift file: rm /var/lib/ntp/drift
- Delete host certificates from /etc/httpd/conf
Distribute the Target VM
- Shutdown the target VM.
- Delete the vmware log files.
- Tar up the virtual machine files.
- Copy the tar file to an FTP server.
