VMware Cloud Community
usr345
Contributor
Contributor

Clone virtual machine

Hello,

Current environment:

Vcenter 4.1

ESXi 4.1

What are the steps to independently clone a production virtual machine in order to ensure production virtual machine is not affected (SID, mac address , netbios name, FQDN etc)

Two virtual machine are Windows 2003 and windwos 2008 R2 that need to be cloned.

My understanding is I should use customize virtual machines to avoid the above mentioned duplicates

Thanks

5 Replies
calvinrobinson
Enthusiast
Enthusiast

Hi,  try cloning the prod VM however DON'T power it on after the clone completes.  Instead, edit the settings of the powered off cloned VM and remove the NIC so that you don't conflict with the prod box.  Bring the clone up and make your hostname changes etc. and you should be good.  Add a new adapter with new IP information to get it onto the network.

VCP4, VCP5, Cloud Infrastructure Consultant
weinstein5
Immortal
Immortal

If you want make sure the MAC address does not change you will have to fix the MAC address in the virtual machine settings because a new MAC address is generated every time the VM is powered on and it is based on the host UUIS and location of the VMX file so if the VM is moved to another host either by vMotion or an HA event a new MAC address will be generated when the VM is powered on unless you fix the address.

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
usr345
Contributor
Contributor

Thank you for the information. Since both the production vm and cloned vm will be on same network, I believe I would want the mac addresses to be different.

So as long as I customize the cloned vm to have a new nic, netbios name, mac etc I should be good.

Steps I will be performing:

Select production vm

Clone

give a new name

Select cluster

Select datastore

Use customization wizard

Computer name will be virtual machine name

select rest of customization

generate new sid

finish

Once vm is cloned, remove network adapter on cloned vm and add a new network adapter. Power the vm on

Check the mac address in edit settings make sure its different for cloned vm

give new ip address to the cloned vm

At this point both the production vm and cloned vm will be powered on the network without issues.

Thanks

0 Kudos
NavalgundRaj
Enthusiast
Enthusiast

Hi


Use the vm recommeded steps as below and let me know furhter.


To clone a virtual machine disk using the ESXi/ESX host terminal:

  1. Log in to the terminal of the ESXi/ESX host. Navigate to the virtual machine's directory using the cd command. It is located at:
    /vmfs/volumes/source_datastore/virtual_machine/Confirm the destination directory where the clone will be copied to. Create this directory, if required.
    For example, if this destination directory does not exist:
    /vmfs/volumes/destination_datastore/virtual_machine/
    Create the directory using this command:
    mkdir /vmfs/volumes/destination_datastore/virtual_machine/
  2. Clone the virtual hard disk using the vmkfstools -i command after shutting down the virtual machine:
    # vmkfstools -i /vmfs/volumes/Storage1/examplevm/examplevm.vmdk /vmfs/volumes/Storage2/examplevm_clone.vmdk
    You see output similar to:

    Destination disk format: VMFS thick
    Cloning disk '/vmfs/volumes/Storage1 (3)/examplevm/examplevm.vmdk'...
    Clone: 100% done.
Note: If you found this correct or answer useful please consider the use of the Correct buttons to award points. Regards Basavaraj.R Navalgund
suvrobhattachar
Enthusiast
Enthusiast

You can use this link to get the steps for clonning a VM - http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=102786...

Note : But before performing clone , keep the sysprep tool in the source VM and then perform the cloning so that you could change SID value of the new VM .

0 Kudos