I just started working with the MOB and learning about MOID's. I was hoping to get the VirtualMachine MOID. We have ESXi hosts with free license. Any way to get this? I just want to execute VirtualMachine.Interact.PowerOn and .Suspend.
Example:
https://balvmware1/mob/?moid=VirtualMachine
Any ideas? Or is this justs available via vcenterserver?
Yes, take a look at this article for details on retrieving MoRef ID http://www.virtuallyghetto.com/2011/11/vsphere-moref-managed-object-reference.html
Regarding the suspend operation, you'll want to read this first http://www.virtuallyghetto.com/2011/06/dreaded-faultrestrictedversionsummary.html
Yes, take a look at this article for details on retrieving MoRef ID http://www.virtuallyghetto.com/2011/11/vsphere-moref-managed-object-reference.html
Regarding the suspend operation, you'll want to read this first http://www.virtuallyghetto.com/2011/06/dreaded-faultrestrictedversionsummary.html
ahh ok. so it looks like my venture will immediately come to an end based on the free version API restrictions. darn.
All I wanted to do was have bacula run "BeforeJob: {suspend VM}" and "AfterJob: {start VM}"
Virtually ghetto sounds fine and all but it seems like a lot less work to do it this way. I really just wanted to port this from vmware server to vsphere:
http://wiki.bacula.org/doku.php?id=application_specific_backups:vmwareserver
You can still perform the suspend operation, but you'll need to directly SSH into the ESXi Shell and use the vim-cmd (http://www.virtuallyghetto.com/p/vmware-vimsh_9940.html)
You can find moid at the address field in web browser when you select VM in vCenter WebClient. See screenshot.
Assuming ssh access is enabled you can ssh into your esx server from a bash terminal i.e...
ssh {ESX IP Address}
Once logged you can run the following command...
vim-cmd vmsvc/getallvms
Which will produce a list of virtual machines on the server. The moid is in the first column.
Real paranoia greying out half of screen.. but answer to the point