Skip to content

Commit

Permalink
spire: turn on snapshots for autoinstall USB disks
Browse files Browse the repository at this point in the history
The newer version of qemu provided by default on buster turns on file
locking by default, which prevents us from installing multiple nodes at
the same time. Turn on snapshot mode, so that none of the VMs will
write back changes to the USB drive -- which is what we want, anyway.
This lets us keep installing multiple VMs at the same time.

We unfortunately can't just set the disk to read-only, because IDE
apparently doesn't support that except for CDROMs, so qemu won't let us
enable the option.
  • Loading branch information
celskeggs committed Feb 7, 2020
1 parent ec52b6d commit 5e2d884
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions platform/spire/src/virt.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,9 @@ def generate_qemu_args(self):
args += ["-drive", "media=disk,file=" + self.hd]
args += ["-boot", "c"]
else:
# TODO: maybe set this readonly
args += ["-drive", "media=%s,format=raw,file=%s" % ("cdrom" if self.cdrom_install else "disk", self.cd)]
# snapshot means that the installer drive won't be modifiable by the VMs, which is useful in qemu 3.0.0+ to
# avoid locking problems when more than one VM is running at the same time.
args += ["-drive", "media=%s,format=raw,file=%s,snapshot=on" % ("cdrom" if self.cdrom_install else "disk", self.cd)]
args += ["-drive", "media=disk,file=" + self.hd]
args += ["-boot", "c"]
args += ["-no-reboot"]
Expand Down

0 comments on commit 5e2d884

Please sign in to comment.