Packer issues
-
Unfortunately, I'm not familiar with the underlying programming necessary to do "pull requests" and things like that. Otherwise I would gladly contribute a fix.
I'm posting here to get information that I have not been able to find elsewhere, having read everything I can find about using Packer to deploy VMs through XO, using this Packer plug-in: https://github.com/ddelnano/packer-plugin-xenserver
Over a few weeks I have managed to find a Packer and RHEL Kickstart configuration that produces a VM in XO. That was a good feeling.
But we also still have to support the VMware platform, and having used the VMware plugin for Packer, I can see important differences that do seem to be issues when you think about them. I'm not sure where is "the right place" to do this, so I'm starting here hoping that I'll either find the right eyeballs or ones that can direct me to the right place.
References: https://github.com/ddelnano/packer-plugin-xenserver
-
Setting the required iso_url variable does not result in the ISO being cached. That poor ISO file is uploaded to an SR each and everytime. And instead of overwriting the existing one, a new copy is spawned on every build. My iso_url is set to use the local filesystem; it would be nice if the plug-in checked to see if the file already existed in the SR before uploading another copy, or at least cleaned-up after itself by deleting the copy. This seems like a bug.
-
Setting the clone_template variable to one of the XO-provided base templates results in an error during packer build complaining that "multiple" have been found. Why is it querying across all pools, when I had to provide credentials to deploy on a specific XCP-ng host? It's easy to get around by making a copy in the pool I'm using with a unique name, but there's nothing in the documentation specifying this is required. This seems like a bug.
-
Setting keep_vm to "always" does not result in the packer-built-VM being kept at the end of the build. Seems like a bug.
-
Setting iso_checksum_type to "none" does not bypass the checksum test. It may be a good thing to perform this during the initial upload of an ISO but... everytime?
-
The link to the following documentation for "In order to see an exhaustive list of configuration options for the packer builder please see the following documentation. " is broken. (https://github.com/ddelnano/packer-plugin-xenserver/tree/master/examples)
-
The link examples in "See the examples for working boot commands." is broken. (https://github.com/ddelnano/packer-plugin-xenserver/blob/master/docs/builders/iso/xenserver-iso.html.markdown)
-
The link xenserver-iso docs in "or complete documentation on configuration commands, see the xenserver-iso docs" is broken. (https://github.com/ddelnano/packer-plugin-xenserver)
In the end... I've got something that works... I'm learning to live with these things, but would love to know if further development is going to be sponsored.
The XCP-ng/XO, Packer and packer-plugin-xenserver developers have my thanks in providing an alternative to VMware.
Mike
Edited to fix my error in referencing the older packer-plugin instead of the new one being maintained by Mr. Dom Del Nano (ddelnano) -
-
Hi,
This repository is not maintained anymore, you should use https://github.com/ddelnano/packer-plugin-xenserver instead. @ddelnano is doing some maintenance on it
-
@olivierlambert ah nuts I pasted in the wrong repo.
Yes, I saw that - this is all still relevant, because I am indeed using this plugin: ddelnano/packer-plugin-xenserver
I'll update my original post.
-
@rochemike Hi ! We're working on a new documentation. The temporary link is this.
Very nice points you brought.
Have you succeed when running
packer init examples/centos/centos8-local.pkr.hcl
example ? -
@rochemike apologies for the late reply. As you've seen, there is lots of improvement for the xenserver-packer-plugin that has been revived from the orphaned upstream repo.
I would greatly appreciate it if you added these issues to the GitHub project. That way we can make sure there is tracking for them.
As for the iso issue you mentioned, that was already tracked and it should be fixed soon (packer-plugin-xenserver#56)!
-
@pedroalvesbatista thank you for asking - yes, I did start with that and used it as a template for a RHEL 8.7 VM.
I want there to be NO DOUBT - I love how this works. I just wish it didn't have those bugs.
-
@ddelnano OK I will, thank you for taking the time to respond. I wasn't sure if having an account at GitHub was enough of a qualification to post an issue. I'll take care of doing that ASAP.
But I'm curious - I don't know if this is a bug, or if it is a feature I haven't learned how to maximize yet. If we already have an ISO on an SR, do we even need to mount the ISO for a network build of Centos/RHEL? Isn't... shouldn't it be possible for the ISO to be mounted by the new build VM as source for creating the new VM, instead of using network build?
The new VM mounts the guest tools to the DVD - which I don't even want to use as I prefer to install a package afterwards. Is it possible to mount the RHEL/Centos ISO instead?
In this situation, this would eliminate 3 minutes of upload, 3 minutes of checksum'ing and would probably halve the amount of time it takes to build the new VM/template.
Thanks again, never heard of packer before a friend turned me on to it, and now I really want to maximize it!
-
@rochemike sorry for the late reply!
If we already have an ISO on an SR, do we even need to mount the ISO for a network build of Centos/RHEL? Isn't... shouldn't it be possible for the ISO to be mounted by the new build VM as source for creating the new VM, instead of using network build?
That is exactly what packer-plugin-xenserver#56 accomplishes.
The new VM mounts the guest tools to the DVD - which I don't even want to use as I prefer to install a package afterwards. Is it possible to mount the RHEL/Centos ISO instead?
I believe the ISO and guest tools are treated the same -- both VBDs are attached as cds. If you can identify what is different about them in the UI or from the
xe
cli that would help me understand what you trying to describe.As for what is possible, if what you want to configure is accessible via the XCP-ng / Xenserver API the packer plugin could be enhanced to perform that action. Hope this helps explain more on the potential possibilities.