vendredi 11 février 2011

ESX VSPhere - Migrate VM from Local Storage to SAN without VCenter

1) Create volume on SAN

2) Follow these high-level steps to move a virtual machine to an alternate location (http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936):

1.Select the virtual machine.
2.Commit all snapshots on the virtual machine. For more information, see Committing snapshots from within the Service Console (1006847).
3.Identify the working directory of the virtual machine.
4.Identify the location of all virtual disks.
5.Power off the virtual machine.
6.Create a folder for the copy of the virtual machine.
7.Copy the virtual machine configuration file (.vmx) to the new folder.
8.Copy the virtual disks to the new folder. For more information, see Moving or Copying Virtual Disks in a VMware Environment (900).
9.Register the new virtual machine.
10.Add the virtual disk copies to the virtual machine copy.
11.Upgrade the virtual hardware if necessary.
12.Power on the virtual machine.
13.Test the new virtual machine.
14.Optionally, delete the original virtual machine files.


Identifying the working directory
vmware-cmd -l

--> /vmfs/volumes/49bf8b5c-63674280-c015-00215xxxxx/VM_Local/VMx_Local.vmx

Identifying the location of all virtual disks
grep -i vmdk /vmfs/volumes/49bf8b5c-63674280-c015-00215xxxxx/VM_Local/VMx_Local.vmx

--> scsi0:0.fileName = "VM_Local.vmdk"

Creating a folder for the copy of the virtual machine
cd /vmfs/volumes/VM_DISK_C
mkdir VM_SAN

Clone VM
vmkfstools -i /vmfs/volumes/49bf8b5c-63674280-c015-00215xxxxx/VM_Local/IMCAS16_Local.vmdk /vmfs/volumes/VM_C/VM_SAN/VM_SAN.vmdk

Copying the virtual machine configuration file to the new folder
cp /vmfs/volumes/49bf8b5c-63674280-c015-00215xxxxx/VM_Local/VM_Local.vmx /vmfs/volumes/VM_DISK_C/VM_SAN/VM_SAN.vmx

Registering a virtual machine
To register a virtual machine from the ESX Service Console, run the command:

vmware-cmd /vmfs/volumes/4d54fe27-a09c1aa5-80a3-00215xxxxx/VM_SAN/VM_SAN.vmx register

Aucun commentaire:

Enregistrer un commentaire