Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Add a uuid based verification of attached state for a volume #1580

Closed
govint opened this issue Jul 13, 2017 · 4 comments
Closed

Add a uuid based verification of attached state for a volume #1580

govint opened this issue Jul 13, 2017 · 4 comments

Comments

@govint
Copy link
Contributor

govint commented Jul 13, 2017

govc vm.Info -vm.ip is the command used to fetch VM meta-data and it needs the calling test functions to have a sleep-wait for a few seconds before issuing the govc command. Instead use the waitip option to govc and it does the wait instead.

The time delay isn't removed completely but it may make it more precise than to wait for a fixed number of seconds in the test code.

@govint
Copy link
Contributor Author

govint commented Jul 13, 2017

Tried this out but still hitting the "no such VM" error with govc,
2017/07/13 12:18:27 Fetching full name for volume [vmlistener_test_volume_823192] from VM [10.161.248.164]
2017/07/13 12:18:28 Full volume name: [vmlistener_test_volume_823192@sharedVmfs-0]
2017/07/13 12:18:32 govc vm.info --waitip=true -vm.ip=10.161.248.164 -json | jq -r .VirtualMachines[].Name
2017/07/13 12:18:32 Expected Attached VM name is [govc: no such VM]
2017/07/13 12:18:32 Attached VM name from Docker CLI is [worker1-VM1.0]
2017/07/13 12:18:32 Attached VM name from Admin CLI is [worker1-VM1.0]

Debugging and will post if this option is usable.

@govint
Copy link
Contributor Author

govint commented Jul 13, 2017

Closing for now, govc doesn't seem to be able to wait for the VM to acquire an IP from multiple test runs. Will raise an issue on govc.

@govint govint closed this as completed Jul 13, 2017
@govint govint changed the title Use -waitip=true when fetching VM metadata via govc. Add a uuid based verification of attached state for a volume Jul 17, 2017
@govint govint reopened this Jul 17, 2017
@govint
Copy link
Contributor Author

govint commented Jul 17, 2017

  1. Add a VerifyAttachedStatusByUuid() to allow fetching VM name by UUid and using that to verify attached state.
  2. (1) saves the 15s timeout after a VM suspend where govc returns error trying to get VM name with the IP.
  3. Move the sleep in esxcli.go:WaitForExpectedState() and vdvs.go:IsVDVSRunning() to after the check on the required state vs. sleeping fist and then checking.
  4. (4) save at least 8s whenever IsVDVSRunningAfterVMRestart() is called.

@govint
Copy link
Contributor Author

govint commented Jul 25, 2017

Opening a new issue with a few enhancements to reduce the time taken in E2E tests. Closing this one.

@govint govint closed this as completed Jul 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant