Registering a virtual machine
To register an existing virtual machine to your vCenter inventory, you have to specify the path to a .vmx
file. A .vmx
file contains the configuration for an existing virtual machine. Here are a few lines from a .vmx
file:
.encoding = "UTF-8" config.version = "8" virtualHW.version = "10" vmci0.present = "TRUE" displayName = "vm4" extendedConfigFile = "vm4.vmxf" floppy0.present = "FALSE" memSize = "256"
You typically don't modify a .vmx
file with an editor, because you might break the connection to the virtual machine. The VMware Knowledge Base article (available at http://kb.vmware.com/kb/1714) gives tips for editing a .vmx
file.
The following example will register a virtual machine named VM4
:
PowerCLI C:\> $Cluster = Get-Cluster –Name Cluster01 PowerCLI C:\> New-VM –Name VM4 –ResourcePool $Cluster ` >> -VMFilePath "[Datastore2] VM4/VM4.vmx" >>
The output of the preceding command is as follows:
Name PowerState Num CPUs MemoryGB...