File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,7 +90,6 @@ vm_start_script "Use Default Settings?" 10 58
9090post_to_api_vm
9191
9292vm_select_storage " $HN "
93- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
9493msg_info " Retrieving the URL for the Debian 12 Qcow2 Disk Image"
9594URL=" https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-$( dpkg --print-architecture) .qcow2"
9695sleep 2
@@ -100,6 +99,13 @@ echo -en "\e[1A\e[0K"
10099FILE=$( basename $URL )
101100msg_ok " Downloaded ${CL}${BL}${FILE}${CL} "
102101
102+ # qm resize only grows the block device. Without cloud-init nothing grows the
103+ # guest partition, so expand it offline first.
104+ if [ " ${CLOUD_INIT:- no} " != " yes" ]; then
105+ msg_info " Expanding the root filesystem to ${DISK_SIZE} "
106+ vm_expand_image " $FILE " " $DISK_SIZE " || true
107+ fi
108+
103109STORAGE_TYPE=$( pvesm status -storage $STORAGE | awk ' NR>1 {print $2}' )
104110case $STORAGE_TYPE in
105111nfs | dir)
Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ vm_start_script "Use Default Settings?" 10 58
9595post_to_api_vm
9696
9797vm_select_storage " $HN "
98- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
9998
10099# ==============================================================================
101100# PREREQUISITES
Original file line number Diff line number Diff line change @@ -135,7 +135,6 @@ function advanced_settings() {
135135# ==============================================================================
136136select_storage () {
137137 vm_select_storage " $HN "
138- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
139138
140139 # Detect storage type for disk format
141140 STORAGE_TYPE=$( pvesm status -storage " $STORAGE " | awk ' NR>1 {print $2}' )
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ vm_start_script "Use Default Settings?" 10 58
9292post_to_api_vm
9393
9494vm_select_storage " $HN "
95- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
9695msg_info " Retrieving the URL for the Arch Linux .iso File"
9796URL=https://geo.mirror.pkgbuild.com/iso/latest/archlinux-x86_64.iso
9897sleep 2
Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ vm_start_script "Use Default Settings?" 10 58
108108post_to_api_vm
109109
110110vm_select_storage " $HN "
111- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
112111
113112# ==============================================================================
114113# PREREQUISITES
177176
178177msg_ok " Customized image"
179178
179+ # qm resize only grows the block device. Without cloud-init nothing grows the
180+ # guest partition, so expand it offline first.
181+ if [ " ${CLOUD_INIT:- no} " != " yes" ]; then
182+ msg_info " Expanding the root filesystem to ${DISK_SIZE} "
183+ vm_expand_image " $WORK_FILE " " $DISK_SIZE " || true
184+ fi
185+
180186STORAGE_TYPE=$( pvesm status -storage " $STORAGE " | awk ' NR>1 {print $2}' )
181187case $STORAGE_TYPE in
182188nfs | dir)
Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ vm_start_script "Use Default Settings?" 10 58
8787post_to_api_vm
8888
8989vm_select_storage " $HN "
90- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
9190msg_info " Retrieving the URL for the Debian 12 Qcow2 Disk Image"
9291URL=https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2
9392sleep 2
@@ -97,6 +96,13 @@ echo -en "\e[1A\e[0K"
9796FILE=$( basename $URL )
9897msg_ok " Downloaded ${CL}${BL}${FILE}${CL} "
9998
99+ # qm resize only grows the block device. Without cloud-init nothing grows the
100+ # guest partition, so expand it offline first.
101+ if [ " ${CLOUD_INIT:- no} " != " yes" ]; then
102+ msg_info " Expanding the root filesystem to ${DISK_SIZE} "
103+ vm_expand_image " $FILE " " $DISK_SIZE " || true
104+ fi
105+
100106STORAGE_TYPE=$( pvesm status -storage $STORAGE | awk ' NR>1 {print $2}' )
101107case $STORAGE_TYPE in
102108nfs | dir)
Original file line number Diff line number Diff line change @@ -106,7 +106,6 @@ vm_start_script "Use Default Settings?" 10 58
106106post_to_api_vm
107107
108108vm_select_storage " $HN "
109- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
110109msg_info " Retrieving the URL for the Debian 12 Qcow2 Disk Image"
111110if [ " $CLOUD_INIT " == " yes" ]; then
112111 URL=https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2
@@ -120,6 +119,13 @@ echo -en "\e[1A\e[0K"
120119FILE=$( basename $URL )
121120msg_ok " Downloaded ${CL}${BL}${FILE}${CL} "
122121
122+ # qm resize only grows the block device. Without cloud-init nothing grows the
123+ # guest partition, so expand it offline first.
124+ if [ " ${CLOUD_INIT:- no} " != " yes" ]; then
125+ msg_info " Expanding the root filesystem to ${DISK_SIZE} "
126+ vm_expand_image " $FILE " " $DISK_SIZE " || true
127+ fi
128+
123129STORAGE_TYPE=$( pvesm status -storage $STORAGE | awk ' NR>1 {print $2}' )
124130case $STORAGE_TYPE in
125131nfs | dir)
Original file line number Diff line number Diff line change @@ -213,7 +213,6 @@ vm_start_script "Use Default Settings?" 10 58
213213post_to_api_vm
214214
215215vm_select_storage " $HN "
216- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
217216
218217if ! command -v virt-customize; then
219218 msg_info " Installing Pre-Requisite libguestfs-tools onto Host"
@@ -233,6 +232,13 @@ echo -en "\e[1A\e[0K"
233232FILE=$( basename $URL )
234233msg_ok " Downloaded ${CL}${BL}${FILE}${CL} "
235234
235+ # qm resize only grows the block device. Without cloud-init nothing grows the
236+ # guest partition, so expand it offline first.
237+ if [ " ${CLOUD_INIT:- no} " != " yes" ]; then
238+ msg_info " Expanding the root filesystem to ${DISK_SIZE} "
239+ vm_expand_image " $FILE " " $DISK_SIZE " || true
240+ fi
241+
236242STORAGE_TYPE=$( pvesm status -storage " $STORAGE " | awk ' NR>1 {print $2}' )
237243case $STORAGE_TYPE in
238244nfs | dir)
Original file line number Diff line number Diff line change @@ -207,7 +207,6 @@ post_to_api_vm
207207# STORAGE SELECTION
208208# ==============================================================================
209209vm_select_storage " $HN "
210- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
211210
212211# ==============================================================================
213212# PREREQUISITES
241240# ==============================================================================
242241# STORAGE TYPE DETECTION
243242# ==============================================================================
243+ # qm resize only grows the block device. Without cloud-init nothing grows the
244+ # guest partition, so expand it offline first.
245+ if [ " ${CLOUD_INIT:- no} " != " yes" ]; then
246+ msg_info " Expanding the root filesystem to ${DISK_SIZE} "
247+ vm_expand_image " $WORK_FILE " " $DISK_SIZE " || true
248+ fi
249+
244250STORAGE_TYPE=$( pvesm status -storage " $STORAGE " | awk ' NR>1 {print $2}' )
245251case $STORAGE_TYPE in
246252nfs | dir)
Original file line number Diff line number Diff line change @@ -209,7 +209,6 @@ vm_start_script "Use Default Settings?" 10 58
209209post_to_api_vm
210210
211211vm_select_storage " $HN "
212- msg_ok " Virtual Machine ID is ${CL}${BL} $VMID ${CL} ."
213212msg_info " Retrieving the URL for the ${OS_DISPLAY} image"
214213URL=$( get_image_url)
215214sleep 2
@@ -219,6 +218,13 @@ echo -en "\e[1A\e[0K"
219218FILE=$( basename $URL )
220219msg_ok " Downloaded ${CL}${BL}${FILE}${CL} "
221220
221+ # qm resize only grows the block device. Without cloud-init nothing grows the
222+ # guest partition, so expand it offline first.
223+ if [ " ${CLOUD_INIT:- no} " != " yes" ]; then
224+ msg_info " Expanding the root filesystem to ${DISK_SIZE} "
225+ vm_expand_image " $FILE " " $DISK_SIZE " || true
226+ fi
227+
222228STORAGE_TYPE=$( pvesm status -storage $STORAGE | awk ' NR>1 {print $2}' )
223229case $STORAGE_TYPE in
224230nfs | dir)
You can’t perform that action at this time.
0 commit comments