summaryrefslogtreecommitdiff
path: root/nova/privsep
diff options
context:
space:
mode:
authorLuyaoZhong <luyao.zhong@intel.com>2019-09-11 07:02:20 +0000
committerLuyaoZhong <luyao.zhong@intel.com>2019-09-13 08:50:35 +0000
commitc39ad2383c1921bda486d58c8670846518caed72 (patch)
tree41e13abc40a86b30f22b3851a891100693413cf0 /nova/privsep
parentd7c07584f1f16059049ebe9d9b97d476c3356ef9 (diff)
downloadnova-c39ad2383c1921bda486d58c8670846518caed72.tar.gz
libvirt: Support VM creation with vpmems and vpmems cleanup
Add the vpmems config into guest config xml according to resources info in the instance object, then users can build a VM with vpmems. Also this patch add the support for data cleanup on the backend device of the vpmems. note: We modify the root <domain> element generated for libvirt to include <maxMemory> elements when memory device is used.[1] Requiring vpmems implies a NUMA topology because libvirt won't let us use vpmem without NUMA.[2] [1]https://github.com/libvirt/libvirt/blob/master/src/qemu/qemu_domain.c#L11593-L11599 [2]https://github.com/libvirt/libvirt/blob/master/src/qemu/qemu_domain.c#L11604-L11615 Change-Id: I725deb0312c930087c9e60115abe68b4e06e6804 Partially-Implements: blueprint virtual-persistent-memory Co-Authored-By: He Jie Xu <hejie.xu@intel.com>
Diffstat (limited to 'nova/privsep')
-rw-r--r--nova/privsep/libvirt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/privsep/libvirt.py b/nova/privsep/libvirt.py
index f4e59acd6c..05a6c8ba4c 100644
--- a/nova/privsep/libvirt.py
+++ b/nova/privsep/libvirt.py
@@ -253,3 +253,9 @@ def get_pmem_namespaces():
ndctl_cmd = ['ndctl', 'list', '-X']
nss_info = processutils.execute(*ndctl_cmd)[0]
return nss_info
+
+
+@nova.privsep.sys_admin_pctxt.entrypoint
+def cleanup_vpmem(devpath):
+ daxio_cmd = ['daxio', '-z', '-o', '%s' % devpath]
+ processutils.execute(*daxio_cmd)