-
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/distributed_port_group: Use MOID as resource ID #202
Conversation
The additions that are in #201 dictate the basis for how we will be working with vSphere networks in the future - any resource that requires a network for a backing (ie: virtual ethernet cards, VMkernel nics, etc) will require a MOID to some sort of network, versus the name itself, allowing us to circumvent actually searching for the network in the downstream resource itself. Searching would be circumvented altogether in the case of DVS portgroups being managed by TF completely as we would just pass the MOID to the downstream resource. The current behaviour of the vsphere_distributed_port_group resource is to use the key attribute in the MO as the ID of the resource, which is documented in the API as the UUID of the DVS port group, although in reality it actually seems to be the MOID, which allows #201 to work without issue right now. However, in order to guarantee that things will be stable in the long run, we need to be sure we are using the right values, so this update changes the ID to be the MOID of the object itself. key is now being exported as a computed attribute of the same name.
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.
Question on dvPortgroupFromMOID
but otherwise looks good
pgID := d.Id() | ||
pg, err := dvPortgroupFromUUID(client, dvsID, pgID) | ||
pg, err := dvPortgroupFromMOID(client, pgID) |
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.
The method signature of dvPortgroupFromMOID
changes here, but I don't see that in the changes here. Was it changed elsewhere, and this resource currently doesn't work without this change?
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.
Not just the signature, but the method as well 🙂
dvPortgroupFromUUID
vs dvPortgroupFromMOID
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.
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.
👍
Thanks @catsby! |
The additions that are in #201 dictate the basis for how we will be
working with vSphere networks in the future - any resource that requires
a network for a backing (ie: virtual ethernet cards, VMkernel nics, etc)
will require a MOID to some sort of network, versus the name itself,
allowing us to circumvent actually searching for the network in the
downstream resource itself. Searching would be circumvented altogether
in the case of DVS portgroups being managed by TF completely as we would
just pass the MOID to the downstream resource.
The current behaviour of the
vsphere_distributed_port_group
resource isto use the
key
attribute in the MO as the ID of the resource, which isdocumented in the API as the UUID of the DVS port group, although in
reality it actually seems to be the MOID, which allows #201 to work
without issue right now. However, in order to guarantee that things will
be stable in the long run, we need to be sure we are using the right
values, so this update changes the ID to be the MOID of the object
itself.
key
is now being exported as a computed attribute of the samename.