It doesn't seem to matter how I construct the datastore path, nothing works.
/Users/matt/.rvm/gems/ruby-1.9.2-p320@veewee/gems/rbvmomi-1.6.0/lib/rbvmomi/vim/Task.rb:11:in `wait_for_completion': InvalidDatastorePath: Invalid datastore path '[EMC-0156-1013]'. (RbVmomi::Fault)
from register.rb:15:in `<main>'
Here is where I try to register the VM...
vm = dc.vmFolder.RegisterVM_Task(:path => '[EMC-0156-1013] rbvmomi_test/rbvmomi_test.vmx',
:asTemplate => false,
:pool => dc.vmFolder._connection.rootFolder.childEntity[0].hostFolder.childEntity[0].resourcePool)
I can test the location of the file and that returns true...
ds = dc.find_datastore('EMC-0156-1013')
puts ds.exists?('rbvmomi_test/rbvmomi_test.vmx') # => true
Any insight on how to construct the path would be awesome.
Could be a bug, can you try it in Perl/PowerCLI to see if it's something unique to rbvmomi?
I successfully used the path output I was generating from the Ruby script using rbvmomi and used that path to register the VM in Powershell.
Sounds like a bug in the Ruby rbvmomi implementation then. May need to contact the maintainers of the project and see if they can fix it (or dig into the source).