Hi guys
I never took the time to create clones or bother with cloud init.
Today I took the time to read up on it and it honestly created more questions than answers.
Also interested in your real world expiriences.
So normally when I need a VM, I simply create a new one and set no SWAP, DHCP and SLAAC, import-id my public key and install qemu-guest-agent. This is not a huge deal,
but apparently, there are some sleeker way to do this. I found 4 ways on how to achieve this, two clone options and two cloud init option.
Clone 1:
I could simply take the VM from above and create a clone.
MAC will be random, but the hostname and probably SSHD I have to change.
Clone 2:
Convert the VM to template.
Basically the same as Clone1, but it is easier to not mess it up, since it is now read only.
Another advantage is that I can create a linked clone (instead of the full clone above).
Question 1: Since I use ZFS this probably works with the built in ZFS snapshot capability and has no performance implications? While saving a little bit of storage?
Question 2: PBS is probably not affected by this will still do a "full" backup, but maybe the dedup ratio is even a little bit higher, since the base should be matching hashes?
Cloud Init 1:
Out of my custom VM, I can also create a cloud init base.
This is even the from the docs preferred way:
Question 3:
Why does the Doc prefer this over downloading say something like the Ubuntu Cloud image? I could imagine that it has better defaults (like no SWAP). Is the document referring to something like a Ubuntu + LAMP VM that you could reuse multiple times?
Question 4:
How does such a VM behave in regards to settings that are defined multiple times?
For example, I set the username to "Sandra" during the install, and set "Sandy" in cloud init, which setting will be used?
Cloud Init 2:
Getting the cloud image from the vendor directly. This seems to be the sleekest option.
Question 5:
How would you "integrate" the guest-agent stuff into this? Creating a yaml file, store that somewhere, add it to the template?
Something like this
How do you handle that in your homelab?
I never took the time to create clones or bother with cloud init.
Today I took the time to read up on it and it honestly created more questions than answers.
Also interested in your real world expiriences.
So normally when I need a VM, I simply create a new one and set no SWAP, DHCP and SLAAC, import-id my public key and install qemu-guest-agent. This is not a huge deal,
but apparently, there are some sleeker way to do this. I found 4 ways on how to achieve this, two clone options and two cloud init option.
Clone 1:
I could simply take the VM from above and create a clone.
MAC will be random, but the hostname and probably SSHD I have to change.
Clone 2:
Convert the VM to template.
Basically the same as Clone1, but it is easier to not mess it up, since it is now read only.
Another advantage is that I can create a linked clone (instead of the full clone above).
Question 1: Since I use ZFS this probably works with the built in ZFS snapshot capability and has no performance implications? While saving a little bit of storage?
Question 2: PBS is probably not affected by this will still do a "full" backup, but maybe the dedup ratio is even a little bit higher, since the base should be matching hashes?
Cloud Init 1:
Out of my custom VM, I can also create a cloud init base.
This is even the from the docs preferred way:
While it may seem convenient to get such ready-to-use images, we usually recommended to prepare the images by yourself. The advantage is that you will know exactly what you have installed, and this helps you later to easily customize the image for your needs.Question 3:
Why does the Doc prefer this over downloading say something like the Ubuntu Cloud image? I could imagine that it has better defaults (like no SWAP). Is the document referring to something like a Ubuntu + LAMP VM that you could reuse multiple times?
Question 4:
How does such a VM behave in regards to settings that are defined multiple times?
For example, I set the username to "Sandra" during the install, and set "Sandy" in cloud init, which setting will be used?
Cloud Init 2:
Getting the cloud image from the vendor directly. This seems to be the sleekest option.
Question 5:
How would you "integrate" the guest-agent stuff into this? Creating a yaml file, store that somewhere, add it to the template?
Something like this
YAML:
#cloud-config
package_update: true
package_upgrade: false
packages:
- qemu-guest-agent
runcmd:
- systemctl enable qemu-guest-agent
- systemctl start qemu-guest-agent
How do you handle that in your homelab?