Place dockvols in datastore root; locate VMs by uuid instead of name #451
Conversation
…by Name Place dockvols to datastore root - Fixe #449. Also , if VM as renamed, the whole "find VM" mechanism was confused - so I fixed by by using search by UUID rather than scan for name. It has a side effect of being faster (on 10 VMs query time dropped from 0.25 sec to 0.05 sec)
Looks good. |
Nice! LGTM. Thanks for quick turnaround. PR description says, "update: oops, looks like volume mount/unmount still does not work. Investigating" Have you already fixed it? I can't see why it would fail. |
Me neither - but it fails to mount the attached disk with "no such file" - looks like a glitch in |
There is no tool/api call to get paths for datastores? This is the kind of stuff we hate to see on the other side when we want to change paths.. else LGTM msterin> Yes, it exists but it would require connection and RPC call for a trivial string operation |
The mapping doesn't exist in some old Ubuntu images. |
94689e6
to
75041ad
Compare
55707d6
to
91b8352
Compare
a490efe
to
d035d3c
Compare
|
||
def find_child(vm_name): | ||
e = None | ||
# Return VM managed object, reconnect if needed. Throws is fails twice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is => if
Great catch on FindVmByName. LGTM. Some minor nits above. |
logging.exception("Failed to find VM uuid=%s (traceback below), " \ | ||
"retrying...", vm_uuid) | ||
# | ||
# Retry. It can throw in connect/search fails. But search can't return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in->if
d035d3c
to
2192098
Compare
fixed nits and merged |
Fixes #449
Test:
make all
, CI, manualManual test:
Running from VM located as
/vmfs/volumes/datastore226/eek/nested/Clone1-Ubuntu 14desktop
:ESX - no dockvols in nested folders, as it is now created in the right place:
VM - we now see volumes created in other (not nested) VMs and can created stuff in the right place:
ESX: - they volumes are indeed in the right place: