[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: which tool should I use to customize a vm ?



On 2022-05-30 14:47:37 +0200 (+0200), PICCA Frederic-Emmanuel wrote:
[...]
> I need to create a bunch of vm image for an openstack instance. In
> this images, we need to install a bunch of software, Debian
> packages, pure binary packages, and does some customisation of the
> configuration for these packages. So I would like to know which
> tool should be use for this purpose.
[...]

As you've probably noticed by now, there are more ways to go about
this than you can count. The most typical solution in my experience
is not to customize the images, but instead to customize the virtual
machines once they boot from a standard image. The cloud-init daemon
can be configured from separate userdata supplied as part of the
boot process, and can do pretty much anything you want to script.
You can also simply supply your own userdata shell script and have
it do whatever you like on first boot. The up side to this is you
don't need to maintain your own images at all.

The second most typical solution I'm aware of is to just supply
enough metadata to boot the standard image to the point where the VM
is reachable over the network, and then point some separate
configuration management and orchestration system like Puppet or
Ansible (or Chef or Salt or...) at it to do your deeper system
configuration. Similarly, this avoids maintaining custom images.

As for needing to automate all of this, the OpenStack APIs are also
fully scriptable, with available SDKs already packaged in Debian, so
if you did want to follow one of the other suggestions to customize
an image by booting a virtual machine and then imaging the result of
your modifications, that's all doable in a handful of Python
function calls.
-- 
Jeremy Stanley

Attachment: signature.asc
Description: PGP signature


Reply to: