vmwareapi get_datastore_ref_and_name needs to be broken up into get_shared_datastores and get_local_datastores

Bug #1200253 reported by Shawn Hartsock
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Unassigned

Bug Description

in vm_util.py method "get_datastore_ref_and_name"

The method description """Get the datastore list and choose the first local storage.""" has the key word "and" which tends to indicate that there is a problem in a method's design. This should probably be the composition of two methods """Get the datastore list.""" and """choose the first local storage.""" in the least. At best, there should be a separate vSphere query to pull only the first local storage so that extra data is not pulled across the wire.

See:
https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vm_util.py#L670

Tags: vmware
Changed in nova:
status: New → Confirmed
summary: vmwareapi get_datastore_ref_and_name needs to be broken up into
- get_datastores and get_local_datastores
+ get_shared_datastores and get_local_datastores
Revision history for this message
Gary Kotton (garyk) wrote :

Is this still an issue? That is, there is the regular expression support and the selection of the DS with e most available memory...

Changed in nova:
status: Confirmed → Incomplete
Revision history for this message
Shawn Hartsock (hartsock) wrote :

This a complaint about bad design. The use of the word "and" in a method name should be a red flag. I currently think we should use a data structure representing lookup details for a datastore including its ref, name, and datacenter.

Changed in nova:
status: Incomplete → Invalid
status: Invalid → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.