Fix LibvirtStorageAdaptor.java - #2696
Conversation
Now the KVM agent checks whether a storage pool is mounted or not mounted before calling storagePoolCreateXML(). Signed-off-by: Kai Takahashi <k-takahashi@creationline.com>
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
wido
left a comment
There was a problem hiding this comment.
I'm wondering why we do this manual unmount. Isn't libvirt supposed to handle this for us? It manages the storage pool and mounts NFS for us. Why do we care about this?
I rather leave this to libvirt
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2094 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
@wido if @cl-k-takahashi reports that it doesn't work in non English environments that could be a problem with libvirt. |
|
@DaanHoogland Yes, I understand, we check for "already mounted" in the code. However, my main point is, why do we manually unmount. Destroying the pool in libvirt should make sure the mountpoint is gone. |
|
so @wido your objection is to |
|
Hmm, yes, I understand you. It would be better if libvirt would handle all this, but it's indeed not part of this PR. |
|
@DaanHoogland The current implementation detects "already mounted" in e.toString() but e.toString() is language configuration dependent. In Japanese environment, it gives "すでにマウントされています" instead of "already mounted" and the KVM agent doesn't unmount the pool. |
|
Trillian test result (tid-2735)
|
|
yes @cl-k-takahashi we understand that. |
yadvr
left a comment
There was a problem hiding this comment.
LGTM. I checked that the mountpoint tool is available on centos6, centos7 and ubuntu, therefore this way of checking if something is indeed mounted should work okay.
|
Test LGTM, merging this based on code reviews and test results, as well as manual testing of mountpoint tool on centos6, centos7 and ubuntu 16.04/18.04. |
Description
I fixed createNetfsStoragePool() function in LibvirtStorageAdaptor.java.
The current implementation of createNetfsStoragePool() does not unmount already mounted pool in non-English environment so I edited it to check the pool is already mounted using mountpoint command and unmount the pool if already mounted.
Types of changes
GitHub Issue/PRs
Screenshots (if appropriate):
How Has This Been Tested?
I got the following output in agent.log in a KVM hypervisor host:
This output indicates already-mounted mountpoint /mnt/00ec8deb-14b2-3264-bd61-4bf38f4bccc5 is successfully unmounted.
Checklist:
Testing