From cd8fd82d09b3636c8667f64d6c3264ba18e118f9 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 21 Feb 2019 00:35:05 +0100 Subject: create_disk_images: create standalone VMDK images They are useful in both VirtualBox and VMware. VDI is horrible and should die and also it is fat. --- kpov_judge/create_disk_images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kpov_judge/create_disk_images.py b/kpov_judge/create_disk_images.py index 2f8fffe..d4a7cfd 100755 --- a/kpov_judge/create_disk_images.py +++ b/kpov_judge/create_disk_images.py @@ -41,7 +41,7 @@ def create_snapshot(class_id, task_id, student_id, computer_name, disk_name, fmt # ensure task dir exists os.makedirs(task_path, exist_ok=True) - if fmt == 'vdi': + if fmt in ('vdi', 'vmdk'): # don’t use backing files, just copy the template os.chdir(task_path) if settings.STUDENT_DISK_COW: @@ -49,7 +49,7 @@ def create_snapshot(class_id, task_id, student_id, computer_name, disk_name, fmt else: subprocess.call(['cp', os.path.join(settings.DISK_TEMPLATE_PATH, template), snap]) - elif fmt in ('qcow2', 'vmdk'): + elif fmt == 'qcow2': # qemu-img create stores backing-file path as given, so link all # backing images to task directory where target image will be # generated -- cgit v1.2.1