-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
machines: add support for existing disk as installation mode for new VMs #11206
machines: add support for existing disk as installation mode for new VMs #11206
Conversation
d96bdd5
to
ef116bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for working on this! Such an useful feature.
ef116bc
to
9995b98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, LGTM!
testCreate is failing on previous test, need to check it. |
This needs more thought, because importing existing disk means that the VMs will not have install phase. Aka the user should never see the install button, which is what is happening now. |
9995b98
to
d426da2
Compare
d426da2
to
c4d6e70
Compare
@martinpitt I did some changes so that the install button will never appear when importing existing disks. |
c4d6e70
to
d510cec
Compare
looks like sometime it fails on lack of memory, decreasing it a bit. |
d510cec
to
19f84b5
Compare
Looks like the new test is a bit flaky on debian stable, And on rhel-8 is failed with timeout to start VM. https://fedorapeople.org/groups/cockpit/logs/pull-11206-20190221-145151-19f84b50-verify-rhel-8-0/TestMachinesDBus-testCreate-rhel-8-0-127.0.0.2-2801-FAIL.png Thinking how to robustify it. |
19f84b5
to
ef5d4d4
Compare
ef5d4d4
to
17075e5
Compare
Looks like the new test fails undeterministically with VM having state == 'paused' instead of running.
|
Two new issues appeared now.. Phewwwww This is probably some ancient libvirt in debian stable, checking for open bug reports. |
is_filesystem_location was renamed to sourceType to be able to support easily more than two different installation methods.
'Filesystem' was renamed to 'Local Install Media' to not be confused with existing disks images as installation source.
…meter When needed it should be written explicitely because for some installation methods it's not neeeded; for example when importing existing disk image.
…empt superuser This is to see files in user-inaccessible paths.
1003638
to
d7c13f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
You can use |
I am creating guests by clicking in the cockpit UI, it's the testCreate. I don't create the guest from the python test code so parameter customization is not possible And I unloaded kvm module, it's allready pushed. But still creation of this last VM sometimes fails without real error from libvirt. |
d7c13f3
to
e6bfbf3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM now, and the tests also seem happy. @KKoukiou , is there anything you still want to change from your side, or was this just waiting on review?
b.select_from_dropdown("#storage-size-unit-select", self.storage_size_unit) | ||
if self.storage_size is not None: | ||
b.set_input_text("#storage-size", str(self.storage_size)) | ||
b.select_from_dropdown("#storage-size-unit-select", self.storage_size_unit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: If it's None
, check that #storage-size
is not present. This makes tests fail more meaningfully if the parameter is accidentally forgotten.
else | ||
DISK_OPTIONS="size=$STORAGE_SIZE,format=qcow2" | ||
COMPARISON=$(awk 'BEGIN{ print "'$STORAGE_SIZE'"<=0 }') | ||
if [ "$COMPARISON" -eq 1 ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not new code, so no need to change it in this PR, but this is "eww". if [ "$STORAGE_SIZE" -le 0 ]
will do just fine.
# This is applicable only for the following test so let's keep it last, | ||
# in order to allow the rest of the tests to run faster with QEMU KVM | ||
# Run modprobe -r in retry loop because it fails sometimes with 'Module kvm is in use' | ||
self.machine.execute("for i in 1 2 3 4 5; do modprobe -r kvm_intel && modprobe -r kvm && break || sleep 1; done") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nitpick for the future: machine.execute()
already has a builtin timeout, and there is no reason to be overly parsimonious about it. Also, for this we have testlib.wait()
:
wait(lambda: self.machine.execute("modprobe -r kvm_intel && modprobe -r kvm"))
All comments addressed in #11272 |
* testCreate test was adjusted to check that storage_size dialog entry is not present when importing existing disk * utilize testlib.wait instead of using for loop in shell and fix condition * introduced some extra expected journal messages from selinux warnings
and the existing

Filesystem
select Entry was renamed toLocal Install media
to avoid confusion.