VMware {code} Community
yskp
Enthusiast
Enthusiast

Creating a new VM with VMware tools

I want to create a new VM using disks that I manipulate (e.g. detach from existing VMs and attach to my new VM). To do this, I'm using the CreateVM_Task API and the VirtualMachineConfigSpec of an existing virtual machine as a template.

My problem is that vCenter automatically decides that VMware tools is not installed on my new machine, and I haven't been able to convince it that it's there. I noticed that the VirtualMachineConfigSpec that I took from the existing VM contains a "tools" member that contains VMware tools information, but despite being copied from the original VM it is reset by vCenter as my new VM is created. I have been unable to set the VM's guestInfo. I tried toying with the extraConfig (I noticed there are some VMware-tools-related keys there), but to no avail.

The reason I want vCenter to realize that VMware tools is installed is because I want to do some customization on that VM. For example, if I import my new VM into vCloud Director, it won't let me change the VM's IP configuration (which requires guest customization), because it thinks VMware tools is not installed.

Now, I realize that if I turn on the machine then vCenter will realize that it has VMware tools installed on it, but I want to avoid this as this is a relatively long operation.

Is there a way to just tell vCenter that VMware tools is installed, without having to power on the machine and wait for it to boot? If anyone can suggest a way to enable guest customization in vCD while vCenter and vCD think VMware tools are disabled, it would also be helpful. If it makes a difference, I'm using the C# SDK on vSphere 5.0.

0 Kudos
0 Replies