Tuesday, July 13, 2010

Naper la aku guna VMWARE esxi ni ....

Author Details
Author: NetworkAdminKB.com
Created: 2008-02-05
Modified: 2008-11-19
Article Content

Issue:

You have not purchased VirtualCenter Server and you are unable to clone a Virtual Machine (VM) on a standalone ESX server using the VI Client.

Cause:

Cloning is only available with VirtualCenter Server.

Solution:

While VirtualCenter Server makes it very easy to clone a VM, it is possible to use command line utilities to simulate the “clone” process that the VirtualCenter Server uses. What follows is the basic procedure that will allow you to manually “clone” (copy) a VM to another directory, modify the configuration files to give the new copy a unique identity, then add the clone to the ESH server’s inventory as a new VM.

Assumptions

1) You have SSH or Console access to the ESX server.

2) You know the root admin password.

Instructions

1) Create a source virtual machine and install the OS.

a. Prepare the OS as needed to be cloned.

2) Power off the source virtual machine

3) Make an SSH connection or login to the Console of the server.

a. If using SSH, use “SU --login” to gain root admin rights to the server.

4) Change to the VMFS location where the source machine is stored.

a. cd /vmfs/volumes/<lun_name>

b. > is the name of the storage on the ESX host.

5) Copy the source VM to the clone destination

a. cp –arp SourceFolder CloneFolder

b. SourceFolder is the name of the source VM that is to be cloned

c. CloneFolder is the name of the Clone VM you wish to create in VMWare.

d. Note: Adding “ &” at the end will put the command into background processing since it will take a while. This is handy if you want to do other things while you wait.

6) Wait for the copy to complete

7) Change to the CloneFolder

a. Cd CloneFolder

8) Rename the files to match the CloneFolder name

a. The folder name and file names should match and are case sensitive.

b. mv source-flat.vdmk CloneFolder-flat.vdmk

c. mv source.nvram CloneFolder.nvram

d. mv source.vdmk CloneFolder.vdmk

e. mv source.vmx CloneFolder.vmx

f. mv source.vmxf CloneFolder.vmxf

9) Delete the original VMSD file

a. rm source.vmsd

b. Normally this file is empty and will be re-created.

10) Edit CloneFolder.vmdk file

a. Remember that the file names are case sensitive.

b. Relpace “source-flat.vdmk” with “CloneFolder-flat.vdmk”

11) Edit CloneFolder.vmx

a. Replace the following 4 instances of the SourceFolder with CloneFolder. Remember that the file names are case sensitive

i. Nvram

ii. displayName

iii. extendedConfigFile

iv. scsi:0.fileName

b. Delete the line sched.swap.derivedName

i. This contains a vswp filename that will be recreated.

12) Open the VI Client and connect to the ESX server.

13) Browse to the datastore where the CloneFolder resides

14) Right Click the .VMX file in the CloneFolder

a. Select Add to Inventory

b. Type the display name of the server.

i. Click Next

c. Click Next on the Resource Pool selection

d. Click Finish

15) Power on the new Cloned VM

16) A window may appear or on the Summary tab you may see the following message.

a. msg.uuid.moved: The location of this virtual machine’s configuration file has changed since it was last powered on…

b. Select “Create”

c. Click OK

17) The clone is now completed.

18) Notes: If the MAC of the NIC is set to manual you will need to change it using the VI Client. If the NIC is configured to automatically select a MAC, it will be changed upon start up.

No comments:

Post a Comment