The get_network and get_raw_network functions in Fog::Vsphere::Compute::Real lib/fog/vsphere/requests/compute/get_network.rb accept either a Name or a _ref attribute of a network object. The Fog::Vsphere::Compute::Network object in lib/fog/vsphere/models/compute/network.rb doesn't currently expose the _ref attribute as a publicly accessible value, even though the data is present in the underlying ActiveRecord from the API call to VSphere.
The _ref attribute should be exposed so that it can be used to later call get_network with a globally unique value. Name may not be unique in some environments. Additionally, at least one client of fog-vsphere (Foreman) currently incorrectly uses the visible id attribute in place of the _ref attribute when calling get_raw_network. This works in many but not all instances as id is often but not always the same value as _ref, depending on how VSphere objects have been edited over time.
The
get_network
andget_raw_network
functions in Fog::Vsphere::Compute::Real lib/fog/vsphere/requests/compute/get_network.rb accept either a Name or a _ref attribute of a network object. The Fog::Vsphere::Compute::Network object in lib/fog/vsphere/models/compute/network.rb doesn't currently expose the _ref attribute as a publicly accessible value, even though the data is present in the underlying ActiveRecord from the API call to VSphere.The _ref attribute should be exposed so that it can be used to later call
get_network
with a globally unique value. Name may not be unique in some environments. Additionally, at least one client of fog-vsphere (Foreman) currently incorrectly uses the visible id attribute in place of the _ref attribute when callingget_raw_network
. This works in many but not all instances as id is often but not always the same value as _ref, depending on how VSphere objects have been edited over time.