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

provider/vsphere: govmomi v0.6.1 update and fixes #6479

Merged
merged 4 commits into from
May 13, 2016
Merged

provider/vsphere: govmomi v0.6.1 update and fixes #6479

merged 4 commits into from
May 13, 2016

Conversation

thetuxkeeper
Copy link
Contributor

@thetuxkeeper thetuxkeeper commented May 4, 2016

I used PR #6472 (thanks @catsby :) ), rebased it to master and started to fix some issues:

  • datatypes
  • RemoveDevice: "keepFiles" boolean was added => false for network devices (should be relevant for disks only)
  • CreateDisk: not additional parameter for the datastore. newDiskPath logic removed ("empty" check is in govmomi now)

cc @chrislovecnm

@chrislovecnm
Copy link
Contributor

LOL - we did the same stuff ... ... I will review.

@chrislovecnm
Copy link
Contributor

This is marked as WIP??

@@ -1692,7 +1684,7 @@ func (vm *virtualMachine) deployVirtualMachine(c *govmomi.Client) error {
for _, dvc := range devices {
// Issue 3559/3560: Delete all ethernet devices to add the correct ones later
if devices.Type(dvc) == "ethernet" {
err := newVM.RemoveDevice(context.TODO(), dvc)
err := newVM.RemoveDevice(context.TODO(), false, dvc)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should consider setting false as a parameter. No change needed at this point.

@chrislovecnm
Copy link
Contributor

@dkalleg @markpeek - please review

@catsby @jen20 @stack72 - can one of you review if you have time?

@thetuxkeeper
Copy link
Contributor Author

@chrislovecnm WIP was because I pushed it without much testing (had to leave the office) and I wasn't completely sure about the function changes.

@jen20
Copy link
Contributor

jen20 commented May 4, 2016

Ideally here someone with a vsphere setup would run the acceptance tests against this branch and ensure that there are no unexpected functional changes here - I just merged a fix from @thetuxkeeper into master, so it's possible it will want further rebasing. Thanks all!

@chrislovecnm
Copy link
Contributor

@jen20 yes I will, just need someone with better golang kungfu to look at the casting that we are doing.

@@ -423,7 +423,7 @@ func resourceVSphereVirtualMachineUpdate(d *schema.ResourceData, meta interface{
configSpec := types.VirtualMachineConfigSpec{}

if d.HasChange("vcpu") {
configSpec.NumCPUs = d.Get("vcpu").(int)
configSpec.NumCPUs = int32(d.Get("vcpu").(int))
Copy link
Contributor

Choose a reason for hiding this comment

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

@jen20 the cast to int32 is new ... opinion? I know you go fu is strong :)

@thetuxkeeper
Copy link
Contributor Author

I'll let the acceptance tests run against this branch with #6480 merged locally (it will fail without it).
@chrislovecnm or do you want to do it? Though it won't hurt if we both check the tests :)

@chrislovecnm
Copy link
Contributor

Both of use need to.... lol

@chrislovecnm
Copy link
Contributor

chrislovecnm commented May 4, 2016

We have something odd going on:

--- FAIL: TestAccVSphereVirtualMachine_basic (163.41s)
    testing.go:172: Step 0 error: Check failed: Check 5/9 error: vsphere_virtual_machine.foo: Attribute 'memory_reservation' expected "4096", got "0"
FAIL
exit status 1
FAIL    github.com/hashicorp/terraform/builtin/providers/vsphere    163.431s

I may not have time to debug today ... But this needs to get resolved.

@thetuxkeeper what is you setup? I am on vSphere 5.5

@markpeek are you able to run the integration tests? I may have environment issues.

@chrislovecnm
Copy link
Contributor

chrislovecnm commented May 4, 2016

@thetuxkeeper do I have your email address? Other topic

@thetuxkeeper
Copy link
Contributor Author

@chrislovecnm the error is fixed with #6480

@chrislovecnm
Copy link
Contributor

... Yah @markpeek just helped me out with that one

@chrislovecnm
Copy link
Contributor

Looking better ... as @markpeek said we need to document how to run the darn integration tests better. Maybe example bash script or something ...

@chrislovecnm
Copy link
Contributor

@thetuxkeeper the only test that is failing is TestAccVSphereVirtualMachine_ipv4Andipv6, but that may be environment issues on my end. Is it passing for you? If so LGTM.

@thetuxkeeper
Copy link
Contributor Author

thetuxkeeper commented May 4, 2016

OS customization doesn't work for me, so even TestAccVSphereVirtualMachine_basic fails (uses DHCP instead of static IP). It seems my template is too minimalist (minimal CentOS 7 installation), have to install some dependencies.

@chrislovecnm
Copy link
Contributor

@thetuxkeeper you have open-vm-tools installed?

@chrislovecnm
Copy link
Contributor

You will want the latest

@thetuxkeeper
Copy link
Contributor Author

TestAccVSphereVirtualMachine_basic passed. perl was missing in the template.
I just started the acceptance tests and had to restart. Forgot to remove the memory reservation => tests without setting it failed expecting it to be "0"

@thetuxkeeper
Copy link
Contributor Author

Most work, but some fail. Will look at it at friday (tomorrow we have a holiday and it's already late here)

=== RUN   TestAccVSphereVirtualMachine_diskInitType
--- FAIL: TestAccVSphereVirtualMachine_diskInitType (79.94s)
        testing.go:172: Step 0 error: Check failed: Check 9/10 error: vsphere_virtual_machine.thin: Attribute 'network_interface.#' expected "1", got "0"

=== RUN   TestAccVSphereVirtualMachine_ipv4Andipv6
--- FAIL: TestAccVSphereVirtualMachine_ipv4Andipv6 (96.15s)
        testing.go:172: Step 0 error: Check failed: Check 10/12 error: vsphere_virtual_machine.ipv4ipv6: Attribute 'network_interface.0.ipv4_gateway' expected "10.30.8.1", got ""
FAIL

Have to check TestAccVSphereVirtualMachine_createWithExistingVmdk too. It seems it deleted the vmdk and the next run it failed not finding the vmdk ... Do I have to copy the vmdk each time?
It also seems to fail to customize since it falls back to DHCP.

--- FAIL: TestAccVSphereVirtualMachine_createWithExistingVmdk (60.54s)
        testing.go:172: Step 0 error: After applying this step, the plan was not empty:

                DIFF:

                UPDATE: vsphere_virtual_machine.with_existing_vmdk
                  network_interface.0.ipv4_address:       "10.30.8.59" => "10.30.8.250"
                  network_interface.0.ipv4_prefix_length: "23" => "24"

@chrislovecnm
Copy link
Contributor

@thetuxkeeper were are we on this? @stack72 has mentioned that 0.7 will not arrive for a bit, and he is recommending that we push it.

Thoughts?

@thetuxkeeper
Copy link
Contributor Author

@chrislovecnm : With #6656 my test run looks good.
If you can confirm that the tests are ok except the network interface fails sometimes, I think we can merge this one.

TF_ACC=1 go test ./builtin/providers/vsphere -v  -timeout 120m
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccVSphereFile_basic
Expected error received: cannot stat '[DS1] tf_file_test.vmdk': No such file
--- PASS: TestAccVSphereFile_basic (4.47s)
=== RUN   TestAccVSphereFile_renamePostCreation
Expected error received: cannot stat '[DS1] tf_test_file_moved.vmdk': No such file
Expected error received: cannot stat '[DS1] tf_test_file.vmdk': No such file
--- PASS: TestAccVSphereFile_renamePostCreation (7.60s)
=== RUN   TestAccVSphereFolder_basic
--- PASS: TestAccVSphereFolder_basic (3.31s)
=== RUN   TestAccVSphereFolder_nested
--- PASS: TestAccVSphereFolder_nested (3.20s)
=== RUN   TestAccVSphereFolder_dontDeleteExisting
--- PASS: TestAccVSphereFolder_dontDeleteExisting (3.71s)
=== RUN   TestAccVSphereVirtualMachine_basic
--- PASS: TestAccVSphereVirtualMachine_basic (97.74s)
=== RUN   TestAccVSphereVirtualMachine_diskInitType
--- PASS: TestAccVSphereVirtualMachine_diskInitType (108.73s)
=== RUN   TestAccVSphereVirtualMachine_dhcp
--- PASS: TestAccVSphereVirtualMachine_dhcp (93.50s)
=== RUN   TestAccVSphereVirtualMachine_custom_configs
--- PASS: TestAccVSphereVirtualMachine_custom_configs (85.98s)
=== RUN   TestAccVSphereVirtualMachine_createInExistingFolder
--- PASS: TestAccVSphereVirtualMachine_createInExistingFolder (85.49s)
=== RUN   TestAccVSphereVirtualMachine_createWithFolder
--- PASS: TestAccVSphereVirtualMachine_createWithFolder (94.29s)
=== RUN   TestAccVSphereVirtualMachine_createWithCdrom
--- PASS: TestAccVSphereVirtualMachine_createWithCdrom (97.25s)
=== RUN   TestAccVSphereVirtualMachine_createWithExistingVmdk
--- PASS: TestAccVSphereVirtualMachine_createWithExistingVmdk (69.68s)
=== RUN   TestAccVSphereVirtualMachine_updateMemory
--- PASS: TestAccVSphereVirtualMachine_updateMemory (139.98s)
=== RUN   TestAccVSphereVirtualMachine_updateVcpu
--- PASS: TestAccVSphereVirtualMachine_updateVcpu (153.46s)
=== RUN   TestAccVSphereVirtualMachine_ipv4Andipv6
--- FAIL: TestAccVSphereVirtualMachine_ipv4Andipv6 (76.18s)
        testing.go:234: Step 0 error: Check failed: Check 7/12 error: vsphere_virtual_machine.ipv4ipv6: Attribute 'network_interface.#' expected "1", got "0"
FAIL
exit status 1
FAIL    github.com/hashicorp/terraform/builtin/providers/vsphere        1124.593s

@chrislovecnm
Copy link
Contributor

@stack72 @jen20 @phinze may we have a merge good sirs!!

@thetuxkeeper thetuxkeeper changed the title [WIP] provider/vsphere govmomi v0.6.1 update fixes provider/vsphere: govmomi v0.6.1 update and fixes May 13, 2016
@stack72
Copy link
Contributor

stack72 commented May 13, 2016

Merging as requested :) Thanks all!

@stack72 stack72 merged commit 390b0d5 into hashicorp:master May 13, 2016
@chrislovecnm
Copy link
Contributor

@stack72 thanks Paul

@thetuxkeeper
Copy link
Contributor Author

@stack72 Thanks! :)

@thetuxkeeper thetuxkeeper deleted the govmomi-update-fixes branch May 13, 2016 15:18
cristicalin pushed a commit to cristicalin/terraform that referenced this pull request May 24, 2016
* vendor: Update dependency vmware/govmomi

* fixed data types

* fixed RemoveDevice

* fixed CreateDisk usage
@ghost
Copy link

ghost commented Apr 25, 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 25, 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.

5 participants