[RFC] builder/vmware: Support ESXi with the vmware-vmx builder#4591
[RFC] builder/vmware: Support ESXi with the vmware-vmx builder#4591klaamane wants to merge 22 commits intohashicorp:masterfrom
Conversation
|
I've tested this PR and have had mostly good results. A couple of comments:
I've pushed my quoting changes here, but I don't know how to get them into this PR. |
679765f to
1a21a2d
Compare
|
Thanks @spmiller for testing this out! I added a comment to the documentation about the source_path. Also I merged your filename fix. I will still investigate the last issue you brought up. It should definitely not leave the built sever on. Having the option to export might be a good idea even though that would be a totally new feature for the vmware-vmx builder. |
|
Before this PR is accepted, I'd like to add a few comments, if that is ok, as we would like to use a big part of this PR if it makes it into packer I, like @spmiller, was also surprised that the I also agree with @spmiller that, ideally, the built VM should be exported - preferably exported to Please don't take this as criticism, I'm really excited by this work, and I think it is so close, but it doesn't quite fit our needs as it stands, due to the input/output paths being remote Keep up the good work! |
|
@jimmythedog, if I manage to achieve the vsphere builder I've begun (see #4526 and #1050 for more information), you will be able to start from a clone operation of an already existing VM. An ovftool import before the packer build may fit your need. |
|
Hi @marema31, |
|
Hi @jimmythedog I'm not sure of this assumption, all references I found on this policies are two or three years old. It could be interresting to give a try. |
|
Hi @jimmythedog, I'm trying to understand your use ase better. If you have a local source virtual machine why don't you just use the vmware-vmx builder locally? Our use case is that all the VMs are on an ESXi host and we don't want to copy them back and forth just for doing packer builds. It would not be too hard to support a local vm as a source (and clone it by copying it over the network) if there really is a need for it. |
|
@klaamane I didn't communicate clearly before. I meant that the builder left the modified VM image on the disk of the remote server, not powered on. Sorry for the confusion! I can't speak for @jimmythedog, but our use case is that we already had a (free) ESXi server running and we didn't want the expense of installing a local VMWare software package on all of our a build agents. Thus we have a local VM that we want to upload, modify, and download. Expecting the existing VM to be stored remotely seems reasonable -- if I need to, I can scp it on there myself -- and we can get it back from the remote server with an ovftool post processor step. |
|
Yep, our use case sounds similar to that of @spmiller Again same as @spmiller, we would have to perform some additional pre-processing to get the files onto the remote server, and some additional post-processing to export the VM However, where we vary is that we would not be able to leave VMs stored on the server, as we would not have the disk space to store the various branches/versions - we store them on a nexus server |
|
How realistic is it to have the best of both worlds?
|
|
@jimmythedog https://www.thehumblelab.com/automate-vsphere-template-builds-packer/ Essentially, you have to enable GuestIPHack on the ESXi hypervisor, and configure the firewall to allow connections. 👎 |
|
We don't view that as a big problem, as the ESXi server is behind our
firewall and, to be honest, using the patched builder that behaves like
other ones do (referencing local files) is a big benefit to us.
In other words, we can have a free ESXi server, without the expense and
complication of the vCentre infrastructure, and our scripts are more or
less the same for different builders 👍
…On 16 Feb 2018 5:44 p.m., "Eric" ***@***.***> wrote:
@jimmythedog <https://github.com/jimmythedog>
https://www.thehumblelab.com/automate-vsphere-template-builds-packer/
Essentially, you have to enable GuestIPHack on the ESXi hypervisor, and
configure the firewall to allow connections. 👎
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4591 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC8mE4xloJi6aj8aJiEpSlz7z9uMVmWpks5tVb5ugaJpZM4MLQSG>
.
|
|
And I've got almost completely the opposite use case - I don't control the hypervisor, it is a big licensed vSphere cluster, I can't make the GuestIPHack changes (nor do I want to), I need all of the files to be stored on the remote datastores, I only build on and for this cluster, and I'd much prefer the -iso as opposed to the -vmx build chain, at least for now. I'm testing the 2.0 beta, and it seems to work fairly well, thankfully. (No edge cases yet). |
|
It's good to see the two different use cases articulated so clearly here. Hopefully this goes some way to determining the need to support both scenarios. FWIW, we have the same use case as @jimmythedog, and we've been using his patch in our production setup for nearly a year now. |
|
+1 for @jimmythedog 's use case. I have an internal-only ESXi server (which I already use to build with the released packer options i.e. Question for @jimmythedog @spmiller - which version of ESXi are you running? I tried the plugin and ran into some weird issues, but it might have been my fault..need to revisit it soon. @mwhooker what's the path forward like for getting this added to the main packer release? I guess we need to find some common ground between the different use cases and then rebase that code to the latest..? |
|
I believe that the JetBrains vsphere plugin (https://github.com/jetbrains-infra/packer-builder-vsphere) is approaching stable and if I recall correctly (from a comment on an issue somewhere) the plan was to merge that in as an officially supported builder once it’s “done.” Sent with GitHawk |
|
@tjohnston01 |
|
Any updates on this? |
|
… On Oct 24, 2018, at 12:18, D. Collin Bachi ***@***.***> wrote:
Any updates on this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
I'm torn on what to do with this PR. It predates my maintainership of Packer, which makes it a little weird for me to manage. First, I will say that I'm sorry that we on the Packer team have dropped the ball on reviewing this. Normally, in a situation where I have a stale PR that hasn't been worked on for a year and a half, I just close and say "reopen if you get a chance to resolve conflicts" But deleting it seems wrong because based on the above conversation, there are people who successfully use this branch for their builds. Originally I had hoped I'd be able to close this when the jetbrains team decided to open a PR for their vsphere builder, but no one has done that yet. I've been holding out hope that someone would either take over this PR or that someone would submit a new one, but neither has happened. I think for this to get over the finish line we either need:
My preference here is 3) because it's been maintained this entire time and I suspect is more production hardened. Now, I can close this PR to try to force one of the above options, or I can leave it open in the hopes that someone who has a vested interest in seeing a vsphere builder merged will carry it forward. I think I'm going to leave it, but I'll close if we get to the new year and no one has decided to take it on. Again, I'm really sorry for how long it took to get this non-answer from the Packer team. I've made reviewing incoming PRs a huge priority, so I feel pretty comfortable saying this won't happen again to a fresh PR without conflicts. |
|
Hello @SwampDragons, If you are willing to clarify the vSphere packer plugin never-ending story, you can refer to #4526 that contain the most part of the history on the fate of all the attempt. For my part, I've already close my proposal several months back since it was less achieved than the jetbrain proposal (usage of command-line tool for API interaction in the POC I had provided for review, direct usage of the SDK by them, compatibility with vSphere 6.0 and below for me, with 6.5 and above for them). I'm upset that this hypervisor is not a first-class citizen in Packer, but it seems to be not a priority at this time. Working now for a european cloud provider offering vSphere based product, I can propose you help on testing the selected solution if you need to. |
|
@marema31 I remember closing that PR some time back when you said you'd be happy with the jetbrains one; and then I waited for a jetbrains PR that never came in. I'm sorry you're upset; you have a right to be. If I were waiting on a vsphere builder that never arrived, I'd be upset too. I would love help testing the selected solution, whether it's this PR that someone cleans up or the jetbrains code that someone turns into a PR. And if someone does open a new VSphere PR and you can help me test, I'll schedule it for the next possible release and make getting it in a priority. |
|
Maybe I'm misunderstanding, but I don't see how the jetbrains plugin allows building from a VMX base, or that it replicates the features available in the vmware-vmx builder, the way this PR does. @ideologysec |
|
@collin-bachi-sp looks like that's what their |
|
I'm still digging into it, but at first glance it seems to be missing "vmx_data" and "boot_wait" options from vmware-vmx. It also requires VSphere, while vmware-iso running in remote mode (and presumably vmware-vmx in this PR branch) can work with a standalone ESXi server. |
|
@collin-bachi-sp, effectively there is limitation from vmWare on the usage of API (license only), in #4526 (more precisely #issuecomment-280164510), I've resumed what was my understanding of it. The JetBrain plugin (and the one I had proposed) use the vSphere API that can avoid the direct modification of ESXi configuration, does not need ssh access to ESXi and allow usage of dvs by example. For people that use cloud managed vSphere (as the product I'm working on day job), it is the only solution to use packer. For my test I was able to deploy an nested ESXi and use it with API but only in the trial period. The 'remote' mode of the vmware plugin consider that the ESXi is just another version of the desktop product, it works well if you are able to control every aspect of the ESXi configuration, this PR will effectively work in this case. As I said previously, for my opinion, the two kind of plugin correspond to different needs and one may not superseed the other. @SwampDragons , may my english is too imprecise, I wanted to help this projet (and I always do) I used every day at that time, I proposed a proof of concept based on discussion I had with mainteners and imcomplete because of the fact I was not a developper and does know the golang, it occurs just before the 1.0 release and the team was not able to review and no other helping hands arise. Jetbrain team reviewed my PR, saying that they were developping a better solution and it was decided to wait for their PR. It is not a problem for me, their solutions seems more advanced than the one I proposed (even that some feature I personnaly use was not implemented the last time I tried to use it, but they may be here now). I prefer that the best implementation "wins", but I'd prefer if this implementation could become a "official" one. |
|
@marema31 I understand, thanks. I slept on this, and the reality is that it's on the Packer team for letting it go this long and therefore it's my job to fix it. I'm going to clear my queue and make this PR's particular implementation (updating our vmware-vmx builder to allow chained builds) a priority; I probably won't get it done in time for the 1.3.2 release but hopefully I will for 1.3.3. There are a lot of merge conflicts in this branch. I'll see if it's possible to save much of the original code because I want to preserve credit, but I'm a little worried that I'll end up having to rewrite most of it. As for the vsphere builder/jetbrains approach: you're right that it's a different use case entirely. I'd love to see a PR for it from the jetbrains team, since their builder seems well-maintained and fairly full-featured. After I'm done with this PR, I'll reach out to the jetbrains folks and ask if they mind me pulling their builder into the Packer core. |
|
To follow the rebase process for this branch, see #6927. I decided it was easier to work from a clean PR than force push to this one. I'll leave this PR open until the other is merged. |
|
Builds of a cleaned up/rebased version of this branch are available at #6927; I'd really appreciate it if anyone who has been using this branch for their builds could test out the build on that PR and notify me if anything behaves differently than they expect. I'm hoping to merge it early next week. |
Extend vmware-vmx builder to allow esxi builds. (Rebase of PR #4591)
|
The rebased version of this PR has been merged. Thank you for your patience on this one. |
|
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. |
This PR enables the vmware-vmx builder to do remote (esxi) builds in the same way that vmware-iso does. Some notes:
Unfortunately this PR is much bigger than I originally anticipated. What would it take to get this PR merged some day?