Archive for July 2013

Cloning Virtual Machines in VMware

double

Understanding Clones

A clone is a copy of an existing virtual machine. The existing virtual machine is called the parent of the clone. When the cloning operation is complete, the clone is a separate virtual machine — though it may share virtual disks with the parent virtual machine.

  • Changes made to a clone do not affect the parent virtual machine. Changes made to the parent virtual machine do not appear in a clone.
  • A clone’s MAC address and UUID are different from those of the parent virtual machine.

If you want to save the current state of the virtual machine, so you can revert to that state in case you make a mistake, take a snapshot. If you want to make a copy of a virtual machine for separate use, create a clone.

Full and Linked Clones

There are two types of clone:

  • A full clone is an independent copy of a virtual machine that shares nothing with the parent virtual machine after the cloning operation. Ongoing operation of a full clone is entirely separate from the parent virtual machine.
  • A linked clone is a copy of a virtual machine that shares virtual disks with the parent virtual machine in an ongoing manner. This conserves disk space, and allows multiple virtual machines to use the same software installation.

Full Clones

A full clone is an independent virtual machine, with no need to access or maintain an ongoing connection to the parent virtual machine. Because a full clone does not share virtual disks with the parent virtual machine, full clones generally perform better than linked clones. However, full clones take longer to create than linked clones. Creating a full clone can take several minutes if the files involved are large.

Linked Clones

A linked clone is made from a snapshot of the parent. All files available on the parent at the moment of the snapshot continue to remain available to the linked clone. Ongoing changes to the virtual disk of the parent do not affect the linked clone, and changes to the disk of the linked clone do not affect the parent.

A linked clone must access the parent. Without access to the parent, a linked clone is disabled.

Linked clones are created swiftly, so you can easily create a unique virtual machine for each task you have. You can also easily share a virtual machine with other users by storing the virtual machine on your local network, where other users can quickly make a linked clone. This facilitates collaboration: for example, a support team can reproduce a bug in a virtual machine, and an engineer can quickly make a linked clone of that virtual machine to work on the bug

The Clone Virtual Machine Wizard

The Clone Virtual Machine Wizard guides through the process of making a clone. You do not need to locate and manually copy the parent virtual machine files. The Clone Virtual Machine Wizard automatically creates a new MAC address and other unique identifiers for the clone.

Warning: Before you power on the virtual machine clone, understand the following

  • Virtual machines clones are issued a new Universally Unique Identifier (UUID). This affect user scripts and API calls to the UUID of the virtual machine.
  • Virtual machines clones are issued new MAC addresses for attached virtual network adapters. This may have an effect on software or licensing that is sensitive to MAC address changes.
  • Guest operating systems for virtual machine clones may share computer names and static IP addresses with their original counterparts. Be sure to account for this prior to power-on

Procedure

Right click on the VM you want to clone

  • Select Clone

Clone1

  •  Put in a name and choose your Inventory location

Clone2

  •  Choose the Host

Clone3

  • Choose your Virtual Disk Format
  • Choose your Datastore

Clone4

  • Click Next
  • Choose to Power on the Machine after creation
  • Choose one of the 2 Customisation options (I have an existing specification)
  • It is not recommended to choose Do Not Customise

Clone5

  • Click Next
  • Review and edit virtual hardware if you need to
  • Finish

clone6

Guest Operating System Customization Requirements in VMware

untitled

What is Guest Operating System Customization

Customizing guest operating systems can help prevent conflicts that can result if virtual machines with identical settings are deployed from a template or cloning, such as conflicts due to duplicate computer names and IP Addresses

You can specify the customization settings by choosing to launch the Guest Customization wizard during the cloning or deployment process. Alternatively, you can create customization specifications, which are customization settings stored in the vCenter Server database. During the cloning or deployment process, you can select a customization specification to apply to the new virtual machine.

Quick Note on Sysprep

The guest operating system customization feature in vCenter Server uses the functions of the Sysprep tool.

Microsoft has a different version of Sysprep for each release and service pack of Windows. You must use the version of Sysprep specific to the operating system you are deploying.The differences are not immediately visible in the packaging and documentation of the service packs

Guest16

You will find the various versions of sysprep in the following directories on vCenter

sysprep

Guest Operating System Customization Requirements

Guest operating system customization is supported only if a number of requirements are met.

  • The most current version of VMware Tools must be installed on the virtual machine or template to customize the guest operating system during cloning or deployment.
  • The guest operating system being customized must be installed on a disk attached as SCSI node 0:0 in the virtual machine configuration.
  • Virtual machines that reside on hosts running ESX Server 3.0.x or earlier have additional disk requirements:

Windows Requirements

  • On a Windows guest operating system, the active partition (the partition containing boot.ini) and the system partition (the partition containing the system directory, for example, \WINNT or WINDOWS) must be on the same virtual disk. The active partition and the system partition do not need to be the same partition
  • Microsoft Sysprep tools must be installed on the vCenter Server system. See Installing the Microsoft Sysprep Tools.
  • Microsoft Sysprep tools must be installed on the vCenter Server system. See Installing the Microsoft Sysprep Tools.
  • The ESX/ESXi host that the virtual machine is running on must be 3.5 or later
  • Guest operating system customization is supported on multiple Windows operating systems. To verify customization support for Windows operating systems and compatible ESX/ESXi hosts, see VMware vSphere Compatibility Matrix

Linux Requirements

  • On a Linux guest operating system, the virtual disk containing the system partition (the partition containing the /etc directory) must reside on the SCSI 0:0 node.)
  • Perl must be installed in the Linux guest operating system.
  • The clone or template must have a root volume formatted with an ext2, ext3, or ReiserFS file system

Procedure

  • Log into vCenter
  • Click Home > Customization Specification Manager
  • Click New
  • Choose Windows or Linux for the Target Virtual Machine O/S
  • Choose a name for your Customization Specification Information

Guest1

  • Click Next
  • Type in Name and Organisation

Guest2

  • I would use Choose “Use the Virtual Machine Name”

Guest3

  • Click Next
  • Put in your Volume Licensing Key
  • Include Server Licensing Information if you are customising a server guest operating system
  • Select Per Seat or Per Server

Guest4

  • Click Next
  • Put in a password for the Admin account
  • Select whether you want to login automatically (Choice is up to you)

Guest5

  • Click Next
  • Choose Timezone

Guest6

  • Click Next
  • Specify any Run once commands

Guest7

  • Click Next and this takes you into Network customisation
  • You can choose Typical or Custom.

Guest8

  • Typical will just assign a DHCP Address which you can change afterwards
  • With Custom, you get the following choices

Guest9

  • If you click New, it will let you add a new adapter say if you wanted a second nic for backup

Guest10

  • If you click the radio button to the side, you get a whole set of options as per below

Guest11

  • Click Next
  • Choose whether you want to join your domain automatically

Guest12

  • Click Next
  • Generate a new SID

Guest13

  • Click Next
  • Review your settings

Guest14

  • Finish