Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

can't find Datastore without known name for Datacenter.find_datastore(name) #2

Closed
jiqiren opened this issue May 10, 2012 · 3 comments
Closed

Comments

@jiqiren
Copy link

jiqiren commented May 10, 2012

Using a fresh install of vsphere v5, i can browse with rvc and see my data store:

~ $ rvc 10.2.0.12
Install the "ffi" gem for better tab completion.
No VMRC available for OS darwin11.0
Using default username "root".
password: 
VMRC is not installed. You will be unable to view virtual machine consoles. Use the vmrc.install command to install it.
/10.2.0.12/ha-datacenter/vm> cd ..
/10.2.0.12/ha-datacenter> ls
0 datastores [datastore]/
1 computers [host]/
2 networks [network]/
3 vms [vm]/
/10.2.0.12/ha-datacenter> cd datastore
/10.2.0.12/ha-datacenter/datastore> ls
0 datastore1: 994.82GB 0.1%
/10.2.0.12/ha-datacenter/datastore> 

However using the ruby gem rbvmomi with the following code does not work:

vim = RbVmomi::VIM.connect(:host => HOST, :user => USER, :password => PASS, :insecure => true )
dc = vim.serviceInstance.find_datacenter(nil) or fail "datacenter not found"
puts dc.pretty_path
dataStore = dc.find_datastore("/")
puts dataStore 

Output is always nil no matter what I pass to dc.find_datastore, dc.find_compute_resource(...) works as expected as does dc.find_vm(...).

Why do I need to explicitly know the exact name of the datastore beforehand? Isn't "find" a search for something? I've been un able to find a way to walk a path to derive a name...

@jrgarcia
Copy link
Contributor

jrgarcia commented Aug 3, 2016

@jiqiren I just started maintaining this library and noticed this issue is 4+ years old. Is this still something you're having trouble with or can I close this?

@jiqiren
Copy link
Author

jiqiren commented Aug 3, 2016

I no longer have access to vsphere - so would not be able to confirm or test any fix. Feel free to close.

@jrgarcia
Copy link
Contributor

jrgarcia commented Aug 3, 2016

@jiqiren Thanks!

@jrgarcia jrgarcia closed this as completed Aug 3, 2016
aimers1975 pushed a commit to aimers1975/rbvmomi that referenced this issue Sep 7, 2018
Allow deployOvf to function even when DNS is not fully configured.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants