mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-17 09:56:59 +02:00
Merge pull request #1953 from flatcar/tormath1/image-ext
vm_image_util: produce qcow2 images for Scaleway
This commit is contained in:
commit
59842e9ee7
@ -101,7 +101,7 @@ compress_disk_images() {
|
||||
# We want to compress images, but we also want to remove the uncompressed files
|
||||
# from the list of uploadable files.
|
||||
for filename in "${local_files_to_evaluate[@]}"; do
|
||||
if [[ "${filename}" =~ \.(img|bin|vdi|vhd|vhdx|vmdk)$ ]]; then
|
||||
if [[ "${filename}" =~ \.(img|bin|vdi|vhd|vhdx|vmdk|qcow[2]?)$ ]]; then
|
||||
# Parse the formats as an array. This will yield an extra empty
|
||||
# array element at the end.
|
||||
readarray -td, FORMATS<<<"${FLAGS_image_compression_formats},"
|
||||
|
@ -110,6 +110,9 @@ IMG_DEFAULT_FS_HOOK=
|
||||
# May be raw, qcow2 (qemu), or vmdk (vmware, virtualbox)
|
||||
IMG_DEFAULT_DISK_FORMAT=raw
|
||||
|
||||
# Extension to set before the compression extension.
|
||||
IMG_DEFAULT_DISK_EXTENSION=
|
||||
|
||||
# Name of the partition layout from disk_layout.json
|
||||
IMG_DEFAULT_DISK_LAYOUT=base
|
||||
|
||||
@ -310,6 +313,7 @@ IMG_scaleway_DISK_LAYOUT=vm
|
||||
IMG_scaleway_OEM_PACKAGE=common-oem-files
|
||||
IMG_scaleway_OEM_USE=scaleway
|
||||
IMG_scaleway_OEM_SYSEXT=oem-scaleway
|
||||
IMG_scaleway_DISK_EXTENSION=qcow2
|
||||
|
||||
###########################################################
|
||||
|
||||
@ -421,6 +425,11 @@ _dst_path() {
|
||||
# Get the proper disk format extension.
|
||||
_disk_ext() {
|
||||
local disk_format=$(_get_vm_opt DISK_FORMAT)
|
||||
local disk_extension=$(_get_vm_opt DISK_EXTENSION)
|
||||
if [[ -n ${disk_extension} ]]; then
|
||||
echo "${disk_extension}"
|
||||
return 0
|
||||
fi
|
||||
case ${disk_format} in
|
||||
raw) echo bin;;
|
||||
qcow2) echo img;;
|
||||
|
1
changelog/changes/2024-04-24-scaleway.md
Normal file
1
changelog/changes/2024-04-24-scaleway.md
Normal file
@ -0,0 +1 @@
|
||||
- Scaleway: images are now provided directly as `.qcow2` to ease the import on Scaleway ([scripts#1953](https://github.com/flatcar/scripts/pull/1953))
|
@ -138,6 +138,8 @@ function _vm_build_impl() {
|
||||
COMPRESSION_FORMAT="bz2,none"
|
||||
elif [[ "${format}" =~ ^(hyperv|hyperv_vhdx)$ ]];then
|
||||
COMPRESSION_FORMAT="zip"
|
||||
elif [[ "${format}" =~ ^(scaleway)$ ]];then
|
||||
COMPRESSION_FORMAT="none"
|
||||
fi
|
||||
./run_sdk_container -n "${vms_container}" -C "${packages_image}" \
|
||||
-v "${vernum}" \
|
||||
|
Loading…
Reference in New Issue
Block a user