-
Notifications
You must be signed in to change notification settings - Fork 455
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
Support VAppConfig for vsphere_virtual_machine resource #243
Comments
Hey @rowanjacobs - thanks for checking in before starting work on this! I have an incoming PR for the new However, I'm curious to the value of these would have when there is no current support for vApps within Terraform. This sounds like it might be setting some vApp options but not really doing anything outside of that. Just quickly looking at the docs here, it looks like editing vApp config options just simply assists with when you want to export the VM, which is a process that might be better suited for something like Packer or some other tool that is designed to build applications based on virtual machines, versus their deployment. If you could reply with more of your use case, or if I'm missing something, we can see if this would be a good fit for the VM resource or not. Thanks! |
Our main use case is to deploy an existing template with configurable IP address, gateway, DNS, and NTP options. Having spiked out some changes to the provider to add values specific to our vSphere cluster for those vAppConfig options, we were able to get the template working after |
Hey @rowanjacobs, when you say "template" - do you mean a traditional template, OVF file, or VM from a vApp? If it's a regular template, we do support customization currently - it's mainly coupled to the entire resource. It's being re-factored in #244 and moved to its own dedicated section - you can see the PR for more details. For OVFs, we do plan on supporting this eventually. The implementation has been envisioned as a two-part import of the VMDKs and VM configuration, and then population of various options in Will wait to hear from you on those questions 🙂 |
We deploy from an OVF file. Do you have a roadmap for OVF support, or an idea of what the UI for VM configuration or |
@rowanjacobs - interesting - so do you upload the OVF first and then clone it? You can view #244 for links to the docs. The exact options necessary will vary depending on the OVF you are deploying, I would imagine, although there might be common ones for vApps. As far as the formal OFV support, there is no ETA, but we will be adding it sometime earlier in the new year, more than likely. The interface will more than likely look like a data source -> resource mapping, so that the VM disk names can be extracted from the virtual machine and what not to be uploaded, but until we dive into it, we won't know for sure. The data source could possibly also provide some sugar around generating the A quick mockup of both the data source and resource example: data "vsphere_ovf_file" "ovf" {
source = "./virutal-appliance.ovf"
properties {
"Address Family" = "ipv4"
"IP Address" = "172.16.0.100"
"IP Prefix" = "24"
"Default Gateway" = "172.16.0.1"
}
}
resource "vsphere_virtual_machine" "vm" {
name = "deployed-appliance"
num_cpus = "${data.vsphere_ovf_file.ovf.num_cpu}"
memory = "${data.vsphere_ovf_file.ovf.memory}"
guest_id = "${data.vsphere_ovf_file.ovf.memory.guest_id}"
ovf = "${data.vsphere_ovf_file.ovf.source}"
extra_config = "${data.vsphere_ovf_file.ovf.extra_config}"
} This is obviously pretty abridged, and the fields would be subject to change, but this is what I'm thinking. The main challenge I could see is that we would need to know the properties ahead of time. These are all things that will sort themselves out over the next couple of months though, and the VM resource is now in a pretty good place to be able to support this functionality in a pretty pluggable way. Hope that gives you a bit of an idea of what's to come! |
Hey all, just thought I'd put some info here on some stuff I've been playing around with trying to get a CoreOS OVF template to work over here. It looks like The main truth here that I can see from my own testing is that The conclusion here is that we will definitely need to support vApp config, at least in a way that allows the appropriate properties to be set. What I would almost like to see is the following:
This will allow us to group vapp configuration, at whatever level we want to support (I don't see why we couldn't support the whole spec though), so that it can properly be set. Default the spec to support communication via the OVF environment transport (aka VMware tools). Absence of the |
Hey @vancluever, just chiming in. As it's unclear how successful you've been with your research I just wanted to let you know that I have been successful in deploying the CoreOS OVA with Ignition using just I haven't had to deploy a plain OVA with TF that doesn't have the glue that CoreOS provides with their cloud-init/ignition vSphere provider (which is pretty unique in the vSphere/OVA landscape), but it seems like that's possible using either ovftool, using --X:injectOvfEnv, or govc with a basic json options file. Here's a blog that goes into using govc to deploy an OVA that depends on ovfEnv https://www.virtuallyghetto.com/2016/04/slick-way-of-deploying-ovfova-directly-to-esxi-vcenter-server-using-govc-cli.html It looks like the flow is reading the base info of the OVA, merging provided options and injecting a marshalled XML into guestinfo.ovfEnv. If this gets implemented it would be nice to document how to dump the available options and correctly configure the provider since all OVAs that I've come in contact with seem to name their options differently and, as you stated, there doesn't seem to be any good source of information on how to do this. I had to combine a lot of unconnected resources to get the Ignition deployment to work. Regarding the interface, one might want to both inject OVF metadata as well as other extra_config. Would that be possible in your latest mockup? Maybe a data provider for extra_config/guestinfo that contains the OVF marshalling logic which always injects that as Hope this is not redundant info :) ps. I haven't tried this but users needing to deploy an OVA right now could probably manually create an XML template and inject that as |
Hey @pall-valmundsson,
This is the part that I actually tried. I wrote up a quick That's when I realized what was going on with the vApp options and how that was being used as a transport for the
Yeah, having the ability to do both is super important. vApp and extraConfig can co-exist in vSphere, so there's no reason they would not be able to in Terraform. It's just a matter of if your extra_config options would be ignored if The issue is if the marshalling data source is actually necessary for the the issues that I ran into. Even if it works in some vSphere implementations, if it doesn't work in all of them then I don't necessarily want it in confusing things, especially if throwing your options in the vApp config properties works 100% of the time. I want to take this on post-1.0.0. Importing OVF/OVA is something that I want to tackle specifically, but honestly, exposing vApp I think gets us a lot farther in supporting this path than we are currently and is really not much work at all, so I think that part might happen first. I think it would be a big win if someone could even just clone an existing template that was imported from OVF that has vApp options set on it and use it like they had just deployed the OVF - without going through all the hassle of importing, etc. PS: On the CoreOS side, I had success by importing the OVF, then removing the vApp options, which allowed me to use the raw |
CC @rowanjacobs on the above ^^^ as you mentioned you wanted to work on a PR. 🙂 if this is something you were planning on taking on, let us know! Also, if you do plan on working on it can you make sure to base your work off #244. |
Thanks! I'll check in with the team but I think it's likely we will be working on a PR. If we do, we'll make sure to use that branch. |
We checked out the provider version with the latest changes to the resource. Without having made any code changes, acceptance tests don't pass because we get Is there a particular version of vSphere that the new resource is targeting? Here's the debug logs:
|
@rowanjacobs I just checked the API docs and |
@rowanjacobs looks like we were able to cleanly remove |
Amazing! Thank you |
We're seeing some more failures, mysterious to us, which might also be related to vSphere version.
It's unclear to us where this |
Hey @rowanjacobs, can you paste your config? |
Actually scratch that. I see that disk |
Thanks! |
@rowanjacobs can you try against #258? |
The "efiSecureBootEnabled" tag seems to also be a problem. (By the way, we've just been running |
First of all, sorry if this is not the place for making questions, but I'm having a really difficult time trying to deploy a CoreOS vm machine on vSphere. I imported a CoreOS OVA file, then created a virtual machine template, and finally, I'm trying to create the virtual machine using that template. @vancluever when you point this:
How do you set up the
and the only thing a I get is a virtual machine with no ip. Is this the right way to set that On the other hand, my cluster is not enabled with DRS, so I have no vApp option tab in my machines. Should I enable it? |
extra_config { Inside the guest I can see the value of key "foo" with command: vmtoolsd --cmd "info-get guestinfo.foo" So that syntax definitely seems to work for me, using terraform v0.11.1 and vsphere provider v1.1.1. |
Based on this comment I am starting to think that my problem is related to that vApp option disabling part. The problem is that the IT guys of my company have told me that we don't own the appropriate license to enable DRS, so I cannot interact with that vApp option tab (that tab is missing in my virtual machines). The question now is, do we have to buy a new license in order to deploy CoreOS virtual machines in vSphere using Terraform? I guess long term solution would be to wait for OVF support on the vSphere provider. |
Since PR #303 was merged I'm going to go ahead and close this issue. |
Hi,
We'd like to automate deploying a template that has some VAppConfig values, including IP, DNS server, gateway, etc. set, but it looks like the
vsphere_virtual_machine
resource currently doesn't support configuring those values.We'd like to PR this support into the provider. We were thinking the config in the resource might look like this:
We wanted to get some feedback on this before we start working on the PR; is this UI acceptable? any concerns about this that we might not be aware of?
cc @christianang
The text was updated successfully, but these errors were encountered: