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

Adding controller creation logic #6853

Merged
merged 1 commit into from
May 31, 2016
Merged

Conversation

dkalleg
Copy link
Contributor

@dkalleg dkalleg commented May 24, 2016

If a scsi or ide controller does not exist at the time a new disk
or cdrom needs it, we need to add that controller to the vm.
Also adding logic to handle reading either a flat or sparse
disk from vSphere.

If a scsi or ide controller does not exist at the time a new disk
or cdrom needs it, we need to add that controller to the vm.
@dkalleg
Copy link
Contributor Author

dkalleg commented May 24, 2016

FYI, my opinion is that the flat/sparse logic is a bit of a work around, the real fix would restructuring the hierarchy of govmomi type structs. The disk.Backing attribute we are returned is of type type.BaseVirtualDeviceBackingInfo. There are multiple types that inherit this, this PR focusing on types.VirtualDiskFlatVer2BackingInfo and types.VirtualDiskSparseVer2BackingInfo because those are the only I've seen returned, and those are the only that have FileName and Uuid attributes we need. We may be given either of these types, which is why I've added the extra type assertion logic. It may be cleaner to add a layer in the hierarchy between these two and BaseVirtualDeviceBackingInfo. Hoping to hear some opinions on this; whether the logic here is enough in the long term or if we should talk to govmomi folks.

@dkalleg
Copy link
Contributor Author

dkalleg commented May 25, 2016

@stack72 I should have mentioned this before to help prioritization: This is a fix for a bug in the addHardDisk function. Without this, adding a disk as IDE in common cases will result in an unhandled Terraform exception: "no available IDE controller". The flat/sparse logic is handling disk dereferencing in the same case.

@chrislovecnm
Copy link
Contributor

@dkalleg if this is a bug fix, which unit test should have caught this??

@dkalleg
Copy link
Contributor Author

dkalleg commented May 25, 2016

I would have expected testAccCheckVSphereVirtualMachineConfig_initType to catch it since it adds both a scsi and an ide disk. Knowing that we saw a pass suggests that the circumstances of the test gave both an ide and scsi controller were created. HOW they were created, I've yet to figure out.. Could have something to do with the specific template I was testing with.

@chrislovecnm
Copy link
Contributor

@dkalleg ready for merge?

@dkalleg
Copy link
Contributor Author

dkalleg commented May 31, 2016

If nobody has comments, then it's ready to go.

@stack72
Copy link
Contributor

stack72 commented May 31, 2016

Hi @dkalleg / @chrislovecnm

As long as you guys are then this is fine with me :) Can we make sure and follow up with some tests on it?

P.

@stack72 stack72 merged commit 1178293 into hashicorp:master May 31, 2016
@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.

3 participants