Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocate VMs after create #583

Merged
merged 2 commits into from
Aug 22, 2018
Merged

Relocate VMs after create #583

merged 2 commits into from
Aug 22, 2018

Conversation

bill-rich
Copy link
Contributor

The host attribute of CreateVM_Task is being ignored in vCenter 6.7.
Adding a host check and reloaction step to ensure that VMs land on
the correct host.

@bill-rich bill-rich force-pushed the b-relocate-after-create branch from 9c880bd to 948c633 Compare August 20, 2018 23:56
@bill-rich bill-rich requested a review from a team August 20, 2018 23:57
@bill-rich bill-rich changed the title [WIP] Relocate VMs after create Relocate VMs after create Aug 20, 2018
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we can get a test for this change or is it environment specific?

@bill-rich
Copy link
Contributor Author

Good call. It was caught originally in the vMotion tests, but now I added on in to check specifically for this issue.

The host attribute of CreateVM_Task is being ignored in vCenter 6.7.
Adding a host check and reloaction step to ensure that VMs land on
the correct host.
@bill-rich bill-rich force-pushed the b-relocate-after-create branch from 05cd5fa to 6f7df39 Compare August 22, 2018 17:35
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bill-rich bill-rich merged commit 8799516 into master Aug 22, 2018
@bill-rich bill-rich deleted the b-relocate-after-create branch August 22, 2018 18:26
@skywalk7
Copy link

skywalk7 commented Sep 1, 2018

Please always check if parameter was actually set with GetOk before comparing value.
This code forces VM vmotion even if host_system_id was not set.

if d.Get("host_system_id").(string) != vprops.Runtime.Host.Reference().Value {

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants