VMware Cloud Community
RJLayton
Contributor
Contributor

Unable to deploy VM from Template after move VC to physical server

I moved our VC to a physical server while trouble shooting other issues. Now I can not deploy a new server from a template.

Is this because the VC server does not have direct access to the SAN? In the VIC logged into VC I can see the template and

I can browse to the datastore and see it, but it fails everytime stating that it can not find the VMDK file. I verified that it is in the

folder. Any ideas?

Thank You!

0 Kudos
21 Replies
sparky84232
Contributor
Contributor

How did you move your VR to a phyical server? was this a reload or a 3rd party V2P

0 Kudos
RJLayton
Contributor
Contributor

Move my VR? You mean VC? It was a a new install not a conversion.

0 Kudos
eldee201110141
Enthusiast
Enthusiast

Did you reinstall the sysprep tools after rebuilding VC?

0 Kudos
kjb007
Immortal
Immortal

Try removing the template from inventory, and then browsing the datastore and then adding it back in.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
RJLayton
Contributor
Contributor

Not sure what you mean by reinstalling the sysprep tools. I'm not fimilar with that or how it related to Virtual Center 2.5

0 Kudos
RJLayton
Contributor
Contributor

Yes. I tried that. No luck

0 Kudos
kjb007
Immortal
Immortal

Easiest way here to check if there is a problem with the template. Convert it to a vm, and see if it will start up. Then convert it back to a template, and try the deploy again.

If the vm does not start, you can look at the vmware.log file and make sure all is well. If the deploy fails, you can check the client logs and vpxd logs to see if it has any other additional details.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
RJLayton
Contributor
Contributor

I did convert it to a VM already. The VM will not start.

Where are these logs located? I searched the VC server and didnt find them.

Thanks!

0 Kudos
seangar
Contributor
Contributor

Try this tidbit...

Resolving this is easy enough. All you have to do is extract the contents of the ‘deploy.cab' from your OS source CD into the one of the sub-directories under (depending on the OS of the image):

‘C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\sysprep'

Hope this helps

Sean

0 Kudos
kjb007
Immortal
Immortal

If vm will not start, check vmware.log, and that is located in the vm folder. When you get a failure, post the log so we can help troubleshoot.

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
Guillir
Enthusiast
Enthusiast

Where the template is located?

local or remote datastore?

0 Kudos
Rubeck
Virtuoso
Virtuoso

The messages about the missing .vmdk also occurs if the .vmdk file is locked..

If running VC 2.5 and someone have played around with the experimental feuture "Edit virtual hardware" before deploying from template, this can result in the situation where the newly deployed VM will use the template.vmdk and not a newly created one. Thats why it might now be locked..

Might wanna check if this is the case..

/Rubeck

RJLayton
Contributor
Contributor

Where is this vmware.log located. I could not find it on the VC server.

0 Kudos
RJLayton
Contributor
Contributor

The templet is located in the 1 datastore we have that is connected via fiber to our SAN.

0 Kudos
RJLayton
Contributor
Contributor

Rubeck, That indeed was done! How do I unlock the file?

0 Kudos
kjb007
Immortal
Immortal

vmware.log is located on the ESX host, in the same folder as the vm. So, it would be in /vmfs/volumes/<datastore>/<vm_name>/vmware.log

-KjB

vExpert/VCP/VCAP vmwise.com / @vmwise -KjB
0 Kudos
Rubeck
Virtuoso
Virtuoso

Find the VM who has the -flat.vmdk and shut it down..... But I guess about now your template has changed when it comes to what settings is in the OS of that template.

Finding the VM who has locked can be tricky if you have a cluster with many hosts, but here's one way to do it.

On one of the host in the cluster execute this:

vmkfstools -D /vmfs/volumes/STORNAME/server_name-flat.vmdk

This will log info about that file to /var/etc/vmkernel. You should see something like:

vmkernel: 17:22:54:57.196 cpu7:1041)Lock [type 10c00001 offset 53997568

vmkernel: gen 71473, mode 1, owner 48032b68-ffb19265-6c1f-00163581d844

The last digits identifies the owner (in this case it is: 00163581d844)

Now find that host by doing the command below every host in the cluster until you find the correct one.

esxcfg-info | grep -i 'system uuid'

That host has then locked the file....So check the running VMs and their assigned disks on that host

/Rubeck

0 Kudos
Rubeck
Virtuoso
Virtuoso

Find the VM who has the -flat.vmdk and shut it down..... But I guess about now your template has changed when it comes to what settings is in the OS of that template.

Finding the VM who has locked can be tricky if you have a cluster with man hosts, but here's one way to do it.

On one of the host in the cluster execute this:

vmkfstools -D /vmfs/volumes/STORNAME/server_name-flat.vmdk

This will log info about that file to /var/log/vmkernel. You should see something like:

vmkernel: 17:22:54:57.196 cpu7:1041)Lock [type 10c00001 offset 53997568

vmkernel: gen 71473, mode 1, owner 48032b68-ffb19265-6c1f-00163581d844

The last digits identifies the owner (in this case it is: 00163581d844)

Now find that host by doing:

esxcfg-info | grep -i 'system uuid'

That host has then locked the file....So check the running VMs and their assigned disks on that host

/Rubeck

Erik_Zandboer
Expert
Expert

Hi,

Try this:

1) Convert the template to a VM

2) Remove the virtual disk (do NOT delete from disk)

3) add harddisk and point to the VMDK file in the same folder

4) try and start the VM. If successful, shutdown VM, convert to template, try to deploy again

5) still failing? Try to create a net VM (custom settings), do not create virtual disk. After creation, add harddisk and browse to the VMDK, try to start that VM.

If it still fails, changes are that the VMDK file is corrupted. Also, to find out if the vmdk has a locking issue, you can try to clone the disk from the command line. In order to do that, login to the (an) esx server via ssh, and perform this:

vmkfstools -i <source.vmdk> <dest.vmdk>

This should clone the VMDK from <source> to <target>. If successful, the target VMDK should not be locked in any case.

Visit my blog at http://www.vmdamentals.com
0 Kudos