User Tools

Site Tools


proxmox:kvm:kvm-automated

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
proxmox:kvm:kvm-automated [2020/05/27 22:30] – [Create the Ansible Playbook] chuckproxmox:kvm:kvm-automated [2021/11/10 06:58] (current) – ↷ Links adapted because of a move operation 173.245.52.212
Line 1: Line 1:
 ======Speedy KVM Creation====== ======Speedy KVM Creation======
-I created a special [[linux:distribution:debian:debian-10-preseed|Debian 10 preseed]] iso just for my Proxmox kvm machines. I can go from zero to ready to rock in under 10 minutes!+I created a special [[linux:distribution:debian:preseed:debian-10-preseed|Debian 10 preseed]] iso just for my Proxmox kvm machines. I can go from zero to ready to rock in under 10 minutes!
  
 ---- ----
Line 7: Line 7:
 The preseeded iso starts automatically, installs a few key packages, sets vim as my default editor and copies my ssh public key to my authorized_keys file so I can run the Ansible playbook right after install. The preseeded iso starts automatically, installs a few key packages, sets vim as my default editor and copies my ssh public key to my authorized_keys file so I can run the Ansible playbook right after install.
  
-  * I created the preseed file then added it to the ISO using my [[:linux:distribution:debian:debian-10-preseed#zero-interaction|Zero Interaction]] method.+  * I created the preseed file then added it to the ISO using my [[linux:distribution:debian:preseed:debian-10-preseed#zero-interaction|Zero Interaction]] method.
   * https://gitlab.com/preseed/preseed-kvm/-/blob/da3402a1f9331fd23816703f62057091b7a36045/preseed.cfg   * https://gitlab.com/preseed/preseed-kvm/-/blob/da3402a1f9331fd23816703f62057091b7a36045/preseed.cfg
  
Line 17: Line 17:
   * https://gitlab.com/ansible9/ansible-kvm/-/blob/master/basic_kvm.yml   * https://gitlab.com/ansible9/ansible-kvm/-/blob/master/basic_kvm.yml
   * Run it like so:<code>   * Run it like so:<code>
-ansible-playbook -v -b --ask-become-pass -i xxx.xxx.xxx.xxx, ansible.yml+ansible-playbook -v -b --ask-become-pass -i xxx.xxx.xxx.xxx, basic_kvm.yml
 </code> </code>
  
Line 24: Line 24:
  
 =====Configure pfSense===== =====Configure pfSense=====
-If it's a VM that I plan on keeping around for a while, I'll give it a static IP address in pfSense before installing Debian. The preseed will use the hostname from pfSense as the system hostname when configuring the network via DHCP. +If it's a VM that I plan on keeping around for a while, I'll give it a static IP address in pfSense before installing Debian. The preseed will use the hostname I assigned it in pfSense as the system hostname when configuring the network via DHCP. 
  
 Otherwise, the system's hostname will be set as //hostname// and it will be assigned an ip address outside of the 'reserved' addresses for the vlan I added it to. Otherwise, the system's hostname will be set as //hostname// and it will be assigned an ip address outside of the 'reserved' addresses for the vlan I added it to.
Line 50: Line 50:
   * Pick a free vmid and create a new VM with your preferred settings:<code>   * Pick a free vmid and create a new VM with your preferred settings:<code>
 sudo qm create 150 --cdrom sas-storage:iso/preseed-debian-10.4.iso \ sudo qm create 150 --cdrom sas-storage:iso/preseed-debian-10.4.iso \
---name preseed --numa 0 --ostype l26 \ +  --name preseed --numa 0 --ostype l26 \ 
---cpu cputype=host --cores 2 --sockets 2 \ +  --cpu cputype=host --cores 2 --sockets 2 \ 
---memory 4096  \ +  --memory 4096  \ 
---net0 bridge=vmbr90,virtio \ +  --net0 bridge=vmbr90,virtio \ 
---bootdisk scsi0 --scsihw virtio-scsi-pci --scsi0 file=ssd-lvm:32 \ +  --bootdisk scsi0 --scsihw virtio-scsi-pci --scsi0 file=ssd-lvm:32 \ 
---serial0 socket --vga qxl --audio0 device=ich9-intel-hda,driver=spice+  --serial0 socket --vga qxl --audio0 device=ich9-intel-hda,driver=spice 
 + 
 +# I'll add macaddr=XX:XX:XX:XX:XX:XX to the --net0 section if I want to pre-configure the ip in pfSense beforehand.
 </code> </code>
   * Start the vm:<code>   * Start the vm:<code>
Line 63: Line 65:
   * Run the ansible playbook.   * Run the ansible playbook.
   * Enjoy!   * Enjoy!
 +  * See ''%%man qm%%'' for more info
  
 ---- ----
proxmox/kvm/kvm-automated.1590618602.txt.gz · Last modified: by chuck