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

vSphere custom vm params #3867

Merged
merged 29 commits into from
Dec 2, 2015

Conversation

chrislovecnm
Copy link
Contributor

This provides support for #3834

Adding new map parameter that contains key value pairs that are stored to ExtraConfig. This provides the capability to store metadata within a virtual machine.

Acceptance test have been provided.

@chrislovecnm
Copy link
Contributor Author

@phinze might you take a look? Would appreciate getting this into master and figuring out when it will be released. Like to coordinate release schedules.

@@ -51,6 +51,7 @@ IMPROVEMENTS:
* provider/digitalocean: Make user_data force a new droplet [GH-3740]
* provider/vsphere: Do not add network interfaces by default [GH-3652]
* provider/openstack: Configure Fixed IPs through ports [GH-3772]
* provider/openstack: Specify a port ID on a Router Interface [GH-3903]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't spot any changes to the openstack provider in this pull request - is this a remnant of another branch? In general we'd prefer it if pull requests didn't update the CHANGELOG, as it tends to lead to frequent merge conflicts. Could you remove this from the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can do ... it is from updating from the master

@jen20
Copy link
Contributor

jen20 commented Nov 15, 2015

Hi @chrislovecnm! I've looked over the code and left a few comments inline. I have no vSphere environment here, however, so I'm relying on the acceptance tests being correct.

@chrislovecnm
Copy link
Contributor Author

@jen20 will work on the two comments. Lots of testing done, and found a couple more bugs when you hit an ipv6 address.

@chrislovecnm
Copy link
Contributor Author

@jen20 so now the build is failing on files that I have not changed ... Joy 😄

I addressed your comments. Lots of testing done

@chrislovecnm
Copy link
Contributor Author

@jen20 merged in upstream master, and now build is happy. We good with a merge now?

resource.TestCheckResourceAttr(
"vsphere_virtual_machine.car", "custom_configuration_parameters.car", "ferrai"),
resource.TestCheckResourceAttr(
"vsphere_virtual_machine.car", "custom_configuration_parameters.num", "42"),
Copy link
Contributor

Choose a reason for hiding this comment

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

These helpers are only checking the state file, so right now no verification is being done on the custom parameters.

In other words, if you remove all your code but the addition of the field to the schema, this test will still pass!

I'd recommend writing a CheckFunc that accepts &vm and inspects it to prove the custom attributes get set.

Something along these lines:

func testAccCheckVSphereVirtualMachineCustomConfigs(vm *virtualMachine) resource.TestCheckFunc {
  return func(s *terraform.State) error {
    // use the vmware client to ensure that the passed in vm has the expected custom config
    // return an error if not
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is exactly what I was asking about in another ticket 😄 Will do!!

@phinze
Copy link
Contributor

phinze commented Nov 19, 2015

Hi @chrislovecnm - looks like the acceptance test could use a bit more work here. Details inline.

Also could you rebase and squash this branch against the latest master? If not we can take care of that fore you at merge time. 👍

@chrislovecnm
Copy link
Contributor Author

@phinze I will try a rebase again.... It turned into one of those rebases 😆

@chrislovecnm
Copy link
Contributor Author

@phinze acceptance test improved. All tests are passing. Comments?

@chrislovecnm
Copy link
Contributor Author

@jen20 @phinze it would be good to get this rolled in, my work on my project is getting pushed because of this ... pretty please 😄

@phinze
Copy link
Contributor

phinze commented Dec 2, 2015

Hey @chrislovecnm - sorry for the delay! Taking a look now

@phinze
Copy link
Contributor

phinze commented Dec 2, 2015

LGTM!

phinze added a commit that referenced this pull request Dec 2, 2015
@phinze phinze merged commit 6c76984 into hashicorp:master Dec 2, 2015
@ghost
Copy link

ghost commented Apr 29, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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

Successfully merging this pull request may close these issues.

3 participants