Update install.sh

This commit is contained in:
colin 2024-08-11 18:59:51 -04:00
parent c492b9aa32
commit b82a47ee52
1 changed files with 5 additions and 3 deletions

View File

@ -49,9 +49,11 @@ echo "Importing the downloaded Ubuntu disk to storage ($STORAGE)..."
qm disk import $VM_ID $IMG_NAME $STORAGE
check_command "Importing disk to storage"
# Step 5: Attach the new disk to the VM as a SCSI drive on the SCSI controller
echo "Attaching the new disk to the VM..."
qm set $VM_ID --scsihw virtio-scsi-pci --scsi0 $STORAGE:vm-$VM_ID-disk-0
# Step 5: Identify the unused disk and attach it to the VM as a SCSI drive on the SCSI controller
echo "Attaching the imported disk to the VM..."
DISK_ID=$(qm config $VM_ID | grep "^unused" | awk -F ':' '{print $1}')
qm set $VM_ID --scsihw virtio-scsi-pci --scsi0 ${STORAGE}:vm-${VM_ID}-disk-0
qm set $VM_ID --delete $DISK_ID
check_command "Attaching disk to VM"
# Step 6: Add cloud init drive