User Tools

Site Tools


tips:proxmox

Differences

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

Link to this comparison view

Next revision
Previous revision
tips:proxmox [2025/10/24 08:40] – created sscipionitips:proxmox [2025/10/29 08:10] (current) – [VM] sscipioni
Line 23: Line 23:
  
  
-import image and attach to template with 50G size+import image and attach to template with two disks 50G size
 <code="bash"> <code="bash">
 # Create a temporary directory to work in # Create a temporary directory to work in
Line 45: Line 45:
 # IMPORTANT: Replace 'local-lvm' with your storage name # IMPORTANT: Replace 'local-lvm' with your storage name
 qm set $VMID --ide2 local-lvm:cloudinit qm set $VMID --ide2 local-lvm:cloudinit
 +
 +
 +# Add a new, empty 50GB disk to the template
 +# IMPORTANT: Replace 'local-lvm' with your storage name
 +qm set $VMID --scsi1 local-lvm:50
  
 # Set the user account that will be created # Set the user account that will be created
Line 57: Line 62:
 qm set $VMID --ipconfig0 ip=dhcp qm set $VMID --ipconfig0 ip=dhcp
 qm set $VMID --ipconfig1 ip=dhcp qm set $VMID --ipconfig1 ip=dhcp
 +# qm set 203 --ipconfig0 ip=10.1.109.203/24,gw=10.1.109.1
  
 # (Optional but recommended) Set a DNS server # (Optional but recommended) Set a DNS server
Line 80: Line 86:
 # Start the new VM # Start the new VM
 qm start $NEW_VMID qm start $NEW_VMID
 +
 +# destroy
 +for i in 201 202 203; do
 + qm stop $i
 + qm destroy $i --destroy-unreferenced-disks
 +done
 +
 +# deploy
 +for i in 201 202 203; do
 + qm clone 9000 $i --name k$i --full
 + qm set $i --ipconfig0 ip=10.1.109.$i/24,gw=10.1.109.1
 + qm set $i --ipconfig1 ip=10.0.0.$i/24
 + qm start $i
 +done
 +
 </code> </code>
  
tips/proxmox.1761288006.txt.gz · Last modified: by sscipioni