debian_ansible_hands-free_installs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| debian_ansible_hands-free_installs [2026/05/10 13:06] – mike | debian_ansible_hands-free_installs [2026/05/12 07:48] (current) – mike | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Debian/ | ===== Debian/ | ||
| - | ==== Create the Debian Cloud-Init | + | ==== Per Spiffyeight77 ==== |
| + | Reference: [[https:// | ||
| + | === Download the Official | ||
| - | Run these commands in the Proxmox | + | # Within |
| + | mkdir -p / | ||
| - | # 1. Download the latest Debian 13 Cloud Image (Generic QCOW2) | + | # Navigate to debian directory |
| - | | + | |
| - | # 2. Create a new VM (ID 9000 used as an example) | + | # Download Debian 13 generic cloud image |
| - | | + | |
| - | # 3. Import the disk into your Proxmox storage (replace ' | + | # Download checksum for verification |
| - | | + | |
| - | # 4. Attach | + | # Verify image integrity |
| + | sha512sum -c SHA512SUMS --ignore-missing | ||
| + | |||
| + | === Create the VM Template === | ||
| + | == Create the Virtual Machine == | ||
| + | qm create 9000 --name debian-13-template --memory 2048 --cores 1 --net0 virtio, | ||
| + | |||
| + | == Import and Configure the Disk == | ||
| + | # Import cloud-init image as VM disk | ||
| + | qm importdisk 9000 / | ||
| + | |||
| + | # Attach disk to VM with VirtIO SCSI | ||
| qm set 9000 --scsihw virtio-scsi-pci --scsi0 local-lvm: | qm set 9000 --scsihw virtio-scsi-pci --scsi0 local-lvm: | ||
| - | # 5. Add Cloud-Init CD-ROM | + | # Add cloud-init drive |
| qm set 9000 --ide2 local-lvm: | qm set 9000 --ide2 local-lvm: | ||
| - | # 6. Configure | + | # Configure boot options |
| - | qm set 9000 --boot c --bootdisk scsi0 --serial0 socket --vga serial0 | + | qm set 9000 --boot c --bootdisk scsi0 |
| + | |||
| + | # Add serial console for cloud-init output | ||
| + | qm set 9000 --serial0 socket --vga serial0 | ||
| + | |||
| + | # Configure the networking | ||
| + | qm set 9000 --ipconfig0 ip=dhcp | ||
| + | |||
| + | # Enable the qemu guest agent(recommend) | ||
| + | qm set 9000 --agent enabled=1 | ||
| + | |||
| + | === Testing the Template (Optional) === | ||
| + | == Start and Verify the VM == | ||
| + | # Start the VM for testing | ||
| + | qm start 9000 | ||
| + | |||
| + | # Check cloud-init configuration | ||
| + | qm cloudinit dump 9000 user | ||
| + | |||
| + | # Monitor startup process | ||
| + | qm console 9000 | ||
| + | |||
| + | # Check the VM IP | ||
| + | qm guest cmd 9000 network-get-interfaces | ||
| + | |||
| + | == Verify Cloud-Init Completion == | ||
| + | Once logged into the VM: | ||
| + | # Check cloud-init status | ||
| + | sudo cloud-init status | ||
| + | |||
| + | # View cloud-init logs | ||
| + | sudo tail -20 / | ||
| - | # 7. Convert | + | # Check system information |
| + | cat / | ||
| + | |||
| + | After successful testing, shutdown the VM: | ||
| + | # Shutdown the VM | ||
| + | qm shutdown 9000 | ||
| + | |||
| + | === Converting to Template === | ||
| + | Convert | ||
| + | # Convert to template (irreversible operation) | ||
| qm template 9000 | qm template 9000 | ||
| + | | ||
| + | === Cloning VMs from Template === | ||
| + | == Using Proxmox Web Interface == | ||
| + | - Navigate to Templates: In the PVE web interface, locate your template (VM ID 9000) | ||
| + | - Clone Template: Right-click → “Clone” or use the Clone button | ||
| + | - Configure Clone Settings: | ||
| + | * VM ID: Choose an unused ID (e.g., 101) | ||
| + | * Name: Descriptive name (e.g., “debian-selfhosted-server”) | ||
| + | * Mode: Full Clone (recommended for production) | ||
| + | * Target Storage: Select appropriate storage | ||
| - | ==== Prepare | + | == Resize Disk After Cloning |
| - | | + | - Access Hardware Tab: Select |
| + | - Resize Disk: Select scsi0 disk -> ' | ||
| + | | ||
| + | == Configure Cloud-Init for New VM == | ||
| + | - Cloud-Init Tab: Navigate to the Cloud-Init tab | ||
| + | - Configure Settings: | ||
| + | * User: Set username (e.g., " | ||
| + | * Password: Set secure password | ||
| + | * SSH Public Key: paste your SSH public key | ||
| + | * IP Config: Choose DHCP or static IP configuration | ||
| + | - Apply Changes: Click " | ||
debian_ansible_hands-free_installs.1778443577.txt.gz · Last modified: by mike
