Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e321cd88
authored
Nov 15, 2026
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raw-data fix
parent
5c0d0529
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
vm.py
+9
-6
vmdriver.py
+4
-1
No files found.
vm.py
View file @
e321cd88
...
...
@@ -98,9 +98,12 @@ class VMInstance:
})
# Building raw data into xml
if
self
.
raw_data
:
raw_data
=
ET
.
fromstring
(
"<raw_data>"
+
self
.
raw_data
+
"</raw_data>"
)
for
child
in
raw_data
:
xml_top
.
append
(
child
)
raw_data
=
ET
.
fromstring
(
self
.
raw_data
)
if
len
(
raw_data
):
for
child
in
raw_data
:
xml_top
.
append
(
child
)
else
:
xml_top
.
append
(
raw_data
)
# Basic virtual machine paramaters
ET
.
SubElement
(
xml_top
,
'name'
)
.
text
=
self
.
name
if
self
.
vcpu
<
self
.
vcpu_max
and
self
.
vcpu_max
!=
0
:
...
...
@@ -267,9 +270,9 @@ class VMDisk:
'name'
:
self
.
driver_name
,
'type'
:
self
.
driver_type
,
'cache'
:
self
.
driver_cache
})
metadata_cache
=
ET
.
SubElement
(
driver
,
'metadata_cache'
)
ET
.
SubElement
(
metadata_cache
,
'max_size'
,
attrib
=
{
'unit'
:
'KB'
})
.
text
=
str
(
self
.
cache_size
)
#
metadata_cache = ET.SubElement(driver, 'metadata_cache')
#
ET.SubElement(metadata_cache, 'max_size',
#
attrib={'unit': 'KB'}).text = str(self.cache_size)
return
xml_top
def
dump_xml
(
self
):
...
...
vmdriver.py
View file @
e321cd88
...
...
@@ -11,7 +11,7 @@ import lxml.etree as ET
from
psutil
import
cpu_count
,
virtual_memory
,
cpu_percent
from
celery.contrib.abortable
import
AbortableTask
from
vm
import
VMInstance
,
VMDisk
,
VMNetwork
from
vmcelery
import
celery
,
lib_connection
,
to_bool
from
vmcelery
import
celery
,
lib_connection
,
to_bool
,
HOSTNAME
from
celery.utils.log
import
get_task_logger
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
basename
(
__file__
)))
...
...
@@ -549,6 +549,9 @@ def migrate(name, host, live=False):
if
live
:
flags
=
flags
|
libvirt
.
VIR_MIGRATE_LIVE
domain
=
lookupByName
(
name
)
if
HOSTNAME
.
startswith
(
host
):
return
# return _parse_info(domain.info())
domain
.
migrateToURI
(
duri
=
"qemu+tcp://"
+
host
+
"/system"
,
flags
=
flags
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment