Automated Provisioning - KVM & CM tools
-
This post will probably seem like I'm jumping around a bit, because I have so many questions about where to begin. So apologies in advance.
I'm starting another project in my home lab. I want to be able to spin up new servers from a clone or template, and then make changes to the new servers automatically. I'd like to accomplish the following:
- On my KVM host (plain Fedora 30 host with KVM), spin up a server, and clone it.
- With that clone, I want the ability to create new servers from that clone, and then tweak different things about the new server such as hostname, IP address, and some other items within the OS or application. (Perhaps with Ansible, Saltstack, other?)
- The assigned IP address for each server can either come from a DHCP server, or from a list of hard coded IP addresses. (I do not currently have a DHCP server in this lab)
I do not currently have any solutions like Openstack, or any other web front ends to easily do this. I manage KVM VMs with both Virt-manager, and with libvirt. I am open to other solutions if they would be a better fit for this type of project.
What is a good solution for this project? Basically, an automation solution for new server setups. (I guess you would consider it private cloud automation.)
-
Its been a while since I've try this before. But you can use something like
virt-builder
to most of what you want if you deploying Linux VMs.
https://developer.fedoraproject.org/tools/virt-builder/about.html -
You can do this with
vagrant
. You can attach login scripts into the Vagrant config file or you can actually build templates which they callboxes
. -
@IRJ said in Automated Provisioning - KVM & CM tools:
You can do this with
vagrant
. You can attach login scripts into the Vagrant config file or you can actually build templates which they callboxes
.Is Vagrant meant for production environments as well? This project is a proof of concept, that I would later hope to take into a production environment.
-
@fuznutz04 said in Automated Provisioning - KVM & CM tools:
@IRJ said in Automated Provisioning - KVM & CM tools:
You can do this with
vagrant
. You can attach login scripts into the Vagrant config file or you can actually build templates which they callboxes
.Is Vagrant meant for production environments as well? This project is a proof of concept, that I would later hope to take into a production environment.
I have used vagrant in my lab and really like it, but if you design your environment properly it wont matter what tool you use to automate the build.
You need to learn scripting so you can utilize bash and/or ansible to do these builds. Then you can use whatever mechanism you want to do the virtualization like vagrant or terraform.
-
Terraform will do this and I have an Ansible role to do it also.
As @IRJ mentioned Vagrant will work also. However I feel Terraform is a better fit as you have more control over the specific pieces of your infrastructure.
-
@stacksofplates said in Automated Provisioning - KVM & CM tools:
Terraform will do this and I have an Ansible role to do it also.
As @IRJ mentioned Vagrant will work also. However I feel Terraform is a better fit as you have more control over the specific pieces of your infrastructure.You would still prefer Terraform over Ansible for this as well?
-
@fuznutz04 said in Automated Provisioning - KVM & CM tools:
@stacksofplates said in Automated Provisioning - KVM & CM tools:
Terraform will do this and I have an Ansible role to do it also.
As @IRJ mentioned Vagrant will work also. However I feel Terraform is a better fit as you have more control over the specific pieces of your infrastructure.You would still prefer Terraform over Ansible for this as well?
Not the same kind of tool. Terraform is about creating virtual infrastructure. Ansible is about management.
-
@fuznutz04 My first thought about how to best do something like this is Ansible. There are several ways but to me this sounds like what Ansible is meant to do.
-
@fuznutz04 said in Automated Provisioning - KVM & CM tools:
@stacksofplates said in Automated Provisioning - KVM & CM tools:
Terraform will do this and I have an Ansible role to do it also.
As @IRJ mentioned Vagrant will work also. However I feel Terraform is a better fit as you have more control over the specific pieces of your infrastructure.You would still prefer Terraform over Ansible for this as well?
Yeah. My role can create the VMs, but Terraform had more functionality for that. Ansible overlaps in the infrastructure provisioning space a lot, but it lacks keeping states like Terraform does.
-
@stacksofplates said in Automated Provisioning - KVM & CM tools:
@fuznutz04 said in Automated Provisioning - KVM & CM tools:
@stacksofplates said in Automated Provisioning - KVM & CM tools:
Terraform will do this and I have an Ansible role to do it also.
As @IRJ mentioned Vagrant will work also. However I feel Terraform is a better fit as you have more control over the specific pieces of your infrastructure.You would still prefer Terraform over Ansible for this as well?
Yeah. My role can create the VMs, but Terraform had more functionality for that. Ansible overlaps in the infrastructure provisioning space a lot, but it lacks keeping states like Terraform does.
I'd like to learn both. I just started with Ansible a day or two ago. I have been (and still am) using SaltStack.