Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts-zfs/build-template
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ VM_MACHINE=${VM_MACHINE:-"q35"}
VM_MEMORY=${VM_MEMORY:-1024}
VM_NET_BRIDGE=${VM_NET_BRIDGE:-"vmbr0"}
VM_NET_TYPE=${VM_NET_TYPE:-"virtio"}
VM_NET_VLAN=${VM_NET_VLAN:-1}
VM_NET_VLAN=${VM_NET_VLAN:-""}
VM_OS=${VM_OS:-"l26"}
VM_RESIZE=${VM_RESIZE:-"1G"}
VM_SCSIHW=${VM_SCSIHW:-"virtio-scsi-pci"}
Expand Down Expand Up @@ -59,7 +59,7 @@ function help() {
--name, -n Specify the VM name (default: 'template')
--net-bridge Specify the VM network bridge (default: 'vmbr0')
--net-type Specify the VM network type (default: 'virtio')
--net-vlan Specify the VM network vlan tag (default: '1')
--net-vlan Specify the VM network vlan tag
--os Specify the VM OS (default: 'l26')
--resize Increase the VM boot disk size (default: '1G')
--scsihw Specify the VM storage controller (default: 'virtio-scsi-pci')
Expand Down Expand Up @@ -229,7 +229,7 @@ function main() {
--bios "${VM_BIOS}" --machine "${VM_MACHINE}" \
--scsihw "${VM_SCSIHW}" --agent enabled=1 \
--cpu cputype=host --memory "${VM_MEMORY}" \
--net0 "${VM_NET_TYPE}",bridge="${VM_NET_BRIDGE}",tag="${VM_NET_VLAN}"
--net0 "${VM_NET_TYPE}",bridge="${VM_NET_BRIDGE}""${VM_NET_VLAN:+,tag=$VM_NET_VLAN}"

# import the cloud image
/usr/sbin/qm disk import "${VM_ID}" "${VM_IMAGE}" "${VM_STORAGE}"
Expand Down
6 changes: 3 additions & 3 deletions scripts/build-template
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ VM_MACHINE=${VM_MACHINE:-"q35"}
VM_MEMORY=${VM_MEMORY:-1024}
VM_NET_BRIDGE=${VM_NET_BRIDGE:-"vmbr0"}
VM_NET_TYPE=${VM_NET_TYPE:-"virtio"}
VM_NET_VLAN=${VM_NET_VLAN:-1}
VM_NET_VLAN=${VM_NET_VLAN:-""}
VM_OS=${VM_OS:-"l26"}
VM_RESIZE=${VM_RESIZE:-"1G"}
VM_SCSIHW=${VM_SCSIHW:-"virtio-scsi-pci"}
Expand Down Expand Up @@ -59,7 +59,7 @@ function help() {
--name, -n Specify the VM name (default: 'template')
--net-bridge Specify the VM network bridge (default: 'vmbr0')
--net-type Specify the VM network type (default: 'virtio')
--net-vlan Specify the VM network vlan tag (default: '1')
--net-vlan Specify the VM network vlan tag
--os Specify the VM OS (default: 'l26')
--resize Increase the VM boot disk size (default: '1G')
--scsihw Specify the VM storage controller (default: 'virtio-scsi-pci')
Expand Down Expand Up @@ -229,7 +229,7 @@ function main() {
--bios "${VM_BIOS}" --machine "${VM_MACHINE}" \
--scsihw "${VM_SCSIHW}" --agent enabled=1 \
--cpu cputype=host --memory "${VM_MEMORY}" \
--net0 "${VM_NET_TYPE}",bridge="${VM_NET_BRIDGE}",tag="${VM_NET_VLAN}"
--net0 "${VM_NET_TYPE}",bridge="${VM_NET_BRIDGE}""${VM_NET_VLAN:+,tag=$VM_NET_VLAN}"

# import the cloud image
/usr/sbin/qm disk import "${VM_ID}" "${VM_IMAGE}" "${VM_STORAGE}"
Expand Down