Setting up Salt agent on KVM templates, so each new VM is a unique Salt minion?

106 views
Skip to first unread message

Victor Hooi

unread,
Jul 26, 2018, 8:42:10 PM7/26/18
to Salt-users
Hi,

We're setting up a test lab based on Proxmox. We have several KVM templates for different configurations (e.g. Windows 10, Windows 8 etc.).

My question is - is there any way to install the Salt minion agent on the template in such a way that each new VM based on that template becomes a new Salt minion, with a unique ID, and ready to go out of the box?

Thanks,
Victor

Dirk Heinrichs

unread,
Jul 27, 2018, 3:25:09 AM7/27/18
to salt-...@googlegroups.com
Victor Hooi:
Did you look at tools like Packer([1]) or salt-cloud([2])?

We use Packer for example to create template Amazon Machine Images
(AMIs) on AWS for Linux and Windows, by installing the minion on them
and let it do the provisioning work.

HTH...

Dirk

[1]: https://www.packer.io/
[2]: https://docs.saltstack.com/en/latest/topics/cloud/
--
Dirk Heinrichs <dirk.he...@altum.de>
GPG Public Key: D01B367761B0F7CE6E6D81AAD5A2E54246986015
Sichere Internetkommunikation: http://www.retroshare.org
Privacy Handbuch: https://www.privacy-handbuch.de

signature.asc

Victor Hooi

unread,
Jul 30, 2018, 6:31:58 PM7/30/18
to Salt-users
Hi Dirk,

Awesome - I had a look at Packer, looks like it might be what we want.

How do you handle approving the keys on the Salt-master, as well as generating unique names for each new machine spun up from an AMI template? (I assume KVM templates are somewhat similar in principle).

Regards,
Victor

Dirk Heinrichs

unread,
Jul 31, 2018, 12:23:13 PM7/31/18
to salt-...@googlegroups.com
Victor Hooi:

> Awesome - I had a look at Packer, looks like it might be what we want.
>
> How do you handle approving the keys on the Salt-master, as well as

We use an autosign.conf file which allows the master to accept certain
keys automatically (by glob pattern). But you can also generate the keys
beforehand and copy them to the VM while provisioning.

> generating unique names for each new machine spun up from an AMI
> template? (I assume KVM templates are somewhat similar in principle).

The names follow a naming convention which includes the role each host
has and a counter for each role. Your mileage may vary, though. Note
that minion ID and hostname doesn't need to match (but it's quite handy
when they do).

HTH...

Dirk
signature.asc
Reply all
Reply to author
Forward
0 new messages