Due to a weird set of circumstances, we have a few vmdk disks on one server that we want to backup so we can move them to another machine (as part of a crash recovery). However, there is currently no virtual machine associated.
I could go through the rigamarole of creating one, but it seems like maybe there should be a way of doing that with vertical backup, without having to create a fake virtual machine?
It is possible to fake a VM, but that requires you to replace /bin/vim-cmd to a script like this:
#!/usr/bin/python
import sys
if sys.argv[1] == "vmsvc/getallvm":
print '''Vmid Name File Guest OS Version Annotation
1 vm-ubuntu [datastore1] vm-ubuntu/vm-ubuntu.vmx ubuntu64Guest vmx-08
'''
elif sys.argv[1] == "vmsvc/power.getstate":
print "Powered off"
And then create a file /vmfs/volumes/datastore1/vm-ubuntu/vm-ubuntu.vmx that has the following line (assuming vm-ubuntu.vmdk is the stand-alone vmdk disk you want to back up) :
scsi0:0.fileName = "vm-ubuntu.vmdk"
This is basically what we did to run Vertical Backup on non-esxi test machines. That being said, this is perhaps more complicated than just creating a dummy VM.