[GH-ISSUE #530] CEPH live-migration, secret usage instead of uuid. #394

Open
opened 2026-02-27 16:39:08 +03:00 by kerem · 0 comments
Owner

Originally created by @ppcedric on GitHub (Mar 23, 2015).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/530

Hi,

To allow live migration of VM in a CEPH environment, it would be better to use the 'usage' attribute instead of the 'uuid' as the secret reference.

The use of the secret UUID require sharing the same secret key UUID between all nodes, else live-migration will fail.
The WEB interface do not allow specifying that UUID, and a new one is created each time you add a secret.
Therefore, a command-line provisionning of secret on other nodes is currently necessary which is not optimal !

As a workaround, we know that the WEB interface allows specifying the 'Usage' (wrongly named 'Data' in the create page...)
So instead of using the UUID as secret reference, i just did that simple change to have live-migration working flawlessly:

diff -rupN webvirtmgr-master/vrtManager/create.py webvirtmgr-sweepay/vrtManager/create.py
--- webvirtmgr-master/vrtManager/create.py      2015-02-16 15:26:45.000000000 +0100
+++ webvirtmgr-sweepay/vrtManager/create.py     2015-03-05 19:47:07.962333337 +0100
@@ -12,8 +12,8 @@ def get_rbd_storage_data(stg):
     xml = stg.XMLDesc(0)
     ceph_user = util.get_xml_path(xml, "/pool/source/auth/@username")
     ceph_host = util.get_xml_path(xml, "/pool/source/host/@name")
-    secrt_uuid = util.get_xml_path(xml, "/pool/source/auth/secret/@uuid")
-    return ceph_user, secrt_uuid, ceph_host
+    secrt_usage = util.get_xml_path(xml, "/pool/source/auth/secret/@usage")
+    return ceph_user, secrt_usage, ceph_host


 class wvmCreate(wvmConnect):
@@ -166,15 +166,15 @@ class wvmCreate(wvmConnect):
             stg_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type")

             if stg_type == 'rbd':
-                ceph_user, secrt_uuid, ceph_host = get_rbd_storage_data(stg)
+                ceph_user, secrt_usage, ceph_host = get_rbd_storage_data(stg)
                 xml += """<disk type='network' device='disk'>
                             <driver name='qemu' type='%s'/>
                             <auth username='%s'>
-                                <secret type='ceph' uuid='%s'/>
+                                <secret type='ceph' usage='%s'/>
                             </auth>
                             <source protocol='rbd' name='%s'>
                                 <host name='%s' port='6789'/>
-                            </source>""" % (img_type, ceph_user, secrt_uuid, image, ceph_host)
+                            </source>""" % (img_type, ceph_user, secrt_usage, image, ceph_host)
             else:
                 xml += """<disk type='file' device='disk'>
                             <driver name='qemu' type='%s'/>

Regards,
Cédric.

Originally created by @ppcedric on GitHub (Mar 23, 2015). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/530 Hi, To allow live migration of VM in a CEPH environment, it would be better to use the 'usage' attribute instead of the 'uuid' as the secret reference. The use of the secret UUID require sharing the same secret key UUID between all nodes, else live-migration will fail. The WEB interface do not allow specifying that UUID, and a new one is created each time you add a secret. Therefore, a command-line provisionning of secret on other nodes is currently necessary which is not optimal ! As a workaround, we know that the WEB interface allows specifying the 'Usage' (wrongly named 'Data' in the create page...) So instead of using the UUID as secret reference, i just did that simple change to have live-migration working flawlessly: ``` diff diff -rupN webvirtmgr-master/vrtManager/create.py webvirtmgr-sweepay/vrtManager/create.py --- webvirtmgr-master/vrtManager/create.py 2015-02-16 15:26:45.000000000 +0100 +++ webvirtmgr-sweepay/vrtManager/create.py 2015-03-05 19:47:07.962333337 +0100 @@ -12,8 +12,8 @@ def get_rbd_storage_data(stg): xml = stg.XMLDesc(0) ceph_user = util.get_xml_path(xml, "/pool/source/auth/@username") ceph_host = util.get_xml_path(xml, "/pool/source/host/@name") - secrt_uuid = util.get_xml_path(xml, "/pool/source/auth/secret/@uuid") - return ceph_user, secrt_uuid, ceph_host + secrt_usage = util.get_xml_path(xml, "/pool/source/auth/secret/@usage") + return ceph_user, secrt_usage, ceph_host class wvmCreate(wvmConnect): @@ -166,15 +166,15 @@ class wvmCreate(wvmConnect): stg_type = util.get_xml_path(stg.XMLDesc(0), "/pool/@type") if stg_type == 'rbd': - ceph_user, secrt_uuid, ceph_host = get_rbd_storage_data(stg) + ceph_user, secrt_usage, ceph_host = get_rbd_storage_data(stg) xml += """<disk type='network' device='disk'> <driver name='qemu' type='%s'/> <auth username='%s'> - <secret type='ceph' uuid='%s'/> + <secret type='ceph' usage='%s'/> </auth> <source protocol='rbd' name='%s'> <host name='%s' port='6789'/> - </source>""" % (img_type, ceph_user, secrt_uuid, image, ceph_host) + </source>""" % (img_type, ceph_user, secrt_usage, image, ceph_host) else: xml += """<disk type='file' device='disk'> <driver name='qemu' type='%s'/> ``` Regards, Cédric.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#394
No description provided.