1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +00:00

fix(vrtManager): an RBD disk takes its pool's auth and monitors as they are

A disk of an RBD pool, at VM creation or added later, had the pool's
user, secret uuid and monitors put into its XML as strings: a user with
a quote or ampersand broke the XML, and a secret named by usage gave
IndexError on attach and uuid='None' at creation. One function now
copies the pool's auth (uuid or usage) and host elements into the
disk's source with lxml, replacing the two string builders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-08 14:42:20 +03:00
parent f94124c891
commit 0ac078b9cc
5 changed files with 76 additions and 82 deletions

View file

@ -58,7 +58,7 @@ from vrtManager.create import cpu_choices, wvmCreate
from vrtManager.instance import USAGE_MAX_WINDOW, wvmInstances
from vrtManager.interface import wvmInterface
from vrtManager.nodedevs import device_names, hostdev_problems, node_devices, pci_problems
from vrtManager.storage import wvmStorage
from vrtManager.storage import rbd_source_children, wvmStorage
from vrtManager.util import randomPasswd
from instances.models import Instance
@ -1307,7 +1307,7 @@ def add_new_vol(request, pk):
format = util.vol_driver_type(conn_pool.get_volume_format_type(os.path.basename(source)), pool_type)
if pool_type == "rbd":
source_info = conn_pool.get_rbd_source()
source_info = rbd_source_children(conn_pool.pool)
else: # add more disk types to handle different pool and disk types
source_info = None
@ -1382,7 +1382,7 @@ def add_existing_vol(request, pk):
format_type = util.vol_driver_type(conn_create.get_volume_format_type(name), pool_type)
disk_type = conn_create.get_volume_type(name)
if pool_type == "rbd":
source_info = conn_create.get_rbd_source()
source_info = rbd_source_children(conn_create.pool)
path = conn_create.get_source_name()
source = f"{path}/{name}"
else: