Add action to resolve disk settings (#1502)

With multi volume boxes, need to ensure that disk settings such as the
device assigned are resolved dynamically once it has been established
which devices have already been assigned to the box volumes on either
initial creation or subsequent boots.

Otherwise users are forced to always explicitly define the device for
additional storage instead of having it be automatically assigned the
next available device.

Consequently previous changes have broken the ability for machines
with additional storage to be halted and restarted correctly.

Include an integration test that for additional storage checks that the
machine can be stopped and started again.

Fixes: #1490
This commit is contained in:
Darragh Bailey
2022-06-02 19:09:18 +01:00
committed by GitHub
parent d1232f0c20
commit 37597e22f9
20 changed files with 986 additions and 256 deletions

View File

@@ -78,6 +78,14 @@ cleanup() {
[ "$status" -eq 0 ]
echo "${output}"
[ $(expr "$output" : ".*second_disk_default-vdb.*") -ne 0 ]
run ${VAGRANT_CMD} halt
echo "${output}"
echo "status = ${status}"
[ "$status" -eq 0 ]
run ${VAGRANT_CMD} up ${VAGRANT_OPT}
echo "${output}"
echo "status = ${status}"
[ "$status" -eq 0 ]
cleanup
}

View File

@@ -6,6 +6,7 @@
Vagrant.configure("2") do |config|
config.vm.box = "infernix/tinycore"
config.ssh.shell = "/bin/sh"
config.ssh.insert_key = false # needed for testing halt as inserted key is persisted
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provider :libvirt do |libvirt|