-
Notifications
You must be signed in to change notification settings - Fork 453
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
r/vm: Support hardware versions #1020
Conversation
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.
LGTM, only some minor comments about nice to haves or questions for my education.
log.Printf("[DEBUG] Upgrading virtual machine %q", vm.InventoryPath) | ||
ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout) | ||
defer cancel() | ||
vm.UpgradeVM(ctx, GetHardwareVersionID(version)) |
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.
Should we be checking the current version of the VM before upgrading? What if the VM has a later newer version or the same version?
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.
This is actually an orphaned function. SetHardwareVersion is what is actually used, and it does validate the versions. Just got this one removed.
@@ -609,6 +609,11 @@ func resourceVSphereVirtualMachineUpdate(d *schema.ResourceData, meta interface{ | |||
return err | |||
} | |||
// Only carry out the reconfigure if we actually have a change to process. | |||
cv := virtualmachine.GetHardwareVersionNumber(vprops.Config.Version) | |||
tv := d.Get("hardware_version").(int) |
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.
What's the default value if there is no hardware version set? 0 ?
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.
Correct. The default value is 0.
Fixes #1000 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
No description provided.