Streamline VM Deployment: Ansible Automation for Proxmox VE

  Рет қаралды 6,702

Tech Tutorials - David McKone

Tech Tutorials - David McKone

Күн бұрын

Пікірлер: 33
@MenkarX
@MenkarX 10 ай бұрын
Such effort is definitely deserves like and subscription! Thanks a lot.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 10 ай бұрын
Thanks for the sub and for taking the time to leave a comment
@373323
@373323 4 ай бұрын
this is awesome, and extremely useful, very good detail
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 4 ай бұрын
Good to know this was useful I found it surprising how much time I was spending even just cloning a template So I want to automate as much as possible
@mariobader2152
@mariobader2152 10 ай бұрын
Ahhh the weekend is saved... I'll definitely recreate one or two things
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 10 ай бұрын
I'm hoping to have everything under the control of Ansible But I know some systems don't offer unattended installs so it could be tricky Hmm..I wonder if I should ask ChatGPT to handle those ones...
@mariobader2152
@mariobader2152 10 ай бұрын
@@TechTutorialsDavidMcKone At the moment, as the last step of a rollout, I name the new computers using Ansible and enter their hostname and IP in the BIND-DNS server using Ansible, too, so that my entire rollout works via Ansible. So I have a separate rollout for each role, whether web server, file server or database server 🙂 I hope you can understand my English to some extent
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 10 ай бұрын
@@mariobader2152 Yeah that makes a lot of sense It's interesting what can be done with Ansible
@mariobader2152
@mariobader2152 10 ай бұрын
@@TechTutorialsDavidMcKone I love Ansible, is a good bridge between infrastructure and programming
@daxcor
@daxcor Ай бұрын
I have been trying to recreate this playbook. One thing you skipped over is the proxmox_kvm package. Where does this come from? From the error I get, it is from a pip module called proxmoxer. How did you install this? from the error, it looks like it is wanting the pip module on the proxmox server itself. Can you elaborate on how you did this please.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Ай бұрын
I should have made that clearer in the assumptions chapter There's a prior video showing how to onboard PVE so Ansible can manage it and includes installing proxmoxer kzbin.info/www/bejne/aniclWh5hM2CrKs
@daxcor
@daxcor Ай бұрын
ok, now that makes more sense.
@daxcor
@daxcor Ай бұрын
The ubuntu cloud init image is a .img file and not qcow2 like Debian. So I am assuming that I have to convert it to qcow2. I used this code # Convert .img to qcow2 - name: Convert the image to qcow2 format ansible.builtin.command: cmd: qemu-img convert -f raw -O qcow2 '{{image_path}}{{item.cloud_init_file_img}}' '{{image_path}}{{item.cloud_init_file_qcow2}}' loop: "{{os_images}}" when: 'item.state == "present"' The play book runs without error, however the vm won't book, says no boot disk found. Any thoughts on what I am doing wrong?
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone Ай бұрын
I haven't used Ubuntu in a long long time and I try to avoid img files There is this on the Proxmox site for using Ubuntu and img files pve.proxmox.com/wiki/Cloud-Init_Support But that's the longer and preferred path of creating your own image files to deploy
@daxcor
@daxcor Ай бұрын
Looks like it is a known bug with proxmoxer, I guess I will use debian.
@jdratlif
@jdratlif 6 ай бұрын
Where did you find that import-from property in the scsi section when creating the host? That's not documented in the community.general collection, but I think it will solve a problem I had with this where I had t be root (not root API token, ROOT) to import the disk image because only root can import from a raw disk path. That's a really nice fix for that which I will be trying RIGHT NOW. Thanks.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 6 ай бұрын
Ansible modules are usually just overlays for commands You can do a lot with Proxmox using the qm command pve.proxmox.com/pve-docs/qm.1.html In there you'll find information about options like "import-from"
@jdratlif
@jdratlif 6 ай бұрын
@@TechTutorialsDavidMcKone I hadn't looked at the module code or the qm CLI which is surely just wrapping the API. I stopped at the community.general docs where it said "it supports these properties", and its lists literally TWO out of the nearly FORTY that are in the qm create section of the manpage. I need to go make a pull request on those docs. Thanks again.
@torbenkorte1156
@torbenkorte1156 2 ай бұрын
really great video. Lots of information, well explained and presented. Only the meaning of the variable creation was not clear to me. Why don't you just create the variables in a file without the hassle of putting them together? You don't gain any flexibility that way, or am I missing something here?
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 2 ай бұрын
For me it's a bit more flexible as I can maintain each VM independently and I don't end up with one big file If I no longer need a VM I can delete its file and next time it won't get added into the master file If everything is in one file I'll have to search for the specific set of information to remove Of course, if I want to add a new VM I just need to add a new file
@torbenkorte1156
@torbenkorte1156 2 ай бұрын
​@@TechTutorialsDavidMcKone thanks for the clarification, i can understand that very well. I simply packed the desired vms into a global variable file. However, I also make my own ansible script for each rollout. What remains is that your video was a great introduction to working with proxmox, thanks again.
@geekinuniform
@geekinuniform 10 ай бұрын
I was able to successfully create this, great work. HOWEVER, have you attempted using Ubuntu cloud init? what challenges did you encounter?
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 10 ай бұрын
I don't use Ubuntu anymore but it should be fine as Canonical started cloud-init As far as I'm aware you should also have more options available
@JamesTremblay
@JamesTremblay 8 ай бұрын
Would you consider an update to this that is more AWX or include dynamic cars? I. E. Query the user for vmname, vmid, CPU, memory, disk size, ipaddress, mask and gateway?
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 8 ай бұрын
Probably not because my long term goal is to just set up Ansible to configure and maintain everything using a few playbooks I prefer to keep things simple, so the aim of the playbooks is to just build the VMs from the ground up, install the relevant application software to each VM and then just regularly apply software and config updates
@JamesTremblay
@JamesTremblay 8 ай бұрын
@@TechTutorialsDavidMcKone my goal too, but I didn't want to have to make changes, commit, sync to AWX then deploy. AWXs survey tools eliminate some of if those steps...
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 8 ай бұрын
@@JamesTremblay I opted for a simple cron job solution basically, using Semaphore So I setup and maintain Ansible as normal but then Semaphore runs the playbook(s) This way I don't touch Semaphore anymore, unless there's an alert to say a task didn't run for instance
@JamesTremblay
@JamesTremblay 8 ай бұрын
@@TechTutorialsDavidMcKone I don't see how a cron job helps with deploying new guests.
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 8 ай бұрын
@@JamesTremblay I have VM files which define the "hardware" specs of each VM I want So if I want to create a new VM I create a new file and the build playbook will create that VM the next time it runs But that only goes as far as the OS installation and some basic settings to make sure only Ansible has access to the VM through SSH The maintenance playbook is next and covers applications and configurations All VMs in the inventory are updated with common settings like time, SSH, etc But each application group has its own specific software and the configs that go with it So new VMs will get software installed and it will be configured, while existing VMs will have config updates if needed It's what I like most about Linux as the config files are text files, so it's easy to upload a change and restart a service
@vincentchov5760
@vincentchov5760 7 ай бұрын
Do you have the full codebase for this somewhere so it can be read easier? Thanks!
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 7 ай бұрын
You can find more details in my blog for this www.techtutorials.tv/sections/promox/automate-vm-creation-on-proxmox-with-ansible/
@vincentchov5760
@vincentchov5760 7 ай бұрын
@@TechTutorialsDavidMcKone my question was in regards to that guide. Is the codebase on github so I can look at it as a whole?
@TechTutorialsDavidMcKone
@TechTutorialsDavidMcKone 7 ай бұрын
I haven't put anything on github yet Currently I'm just uploading sections of code as per the videos I put out
Proxmox VE SDN VXLAN Setup
32:54
Tech Tutorials - David McKone
Рет қаралды 6 М.
Simplify Your Proxmox VE Tasks: Ansible Automation Made Easy
19:42
Tech Tutorials - David McKone
Рет қаралды 12 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
One day.. 🙌
00:33
Celine Dept
Рет қаралды 42 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 21 МЛН
Automate Homelab Deployment With Terraform & Proxmox
26:22
Jim's Garage
Рет қаралды 69 М.
Proxmox, VM Redundancy Using ZFS Replication
30:21
Tech Tutorials - David McKone
Рет қаралды 4,1 М.
You should be using Proxmox Backup Server
10:38
Techno Tim
Рет қаралды 65 М.
Effortlessly Create Proxmox VE Debian Templates at Lightning Speed with Cloud-Init
37:27
Tech Tutorials - David McKone
Рет қаралды 8 М.
Proxmox Backup Server Saves You Money And Time!
24:48
Jim's Garage
Рет қаралды 60 М.
Automating my Homelab with Ansible
13:18
Jeff Geerling
Рет қаралды 345 М.
Proxmox Templates Made Easy: Ansible Automation
13:29
James Rhoat
Рет қаралды 26 М.
How To Create VLANs in Proxmox For a Single NIC
28:35
Tech Tutorials - David McKone
Рет қаралды 119 М.