Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c57c7b83
authored
Sep 14, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding environment settings hypervisor type
parent
3616ce21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
vmdriver.py
+6
-2
No files found.
vmdriver.py
View file @
c57c7b83
...
...
@@ -2,6 +2,7 @@ import libvirt
import
logging
import
os
import
sys
from
vm
import
VMInstance
from
decorator
import
decorator
from
vmcelery
import
celery
,
lib_connection
...
...
@@ -89,7 +90,7 @@ def define(vm):
@celery.task
@req_connection
def
create
(
vm
):
def
create
(
vm
_desc
):
'''Create and start non-permanent virtual machine from xml
flags can be:
VIR_DOMAIN_NONE = 0
...
...
@@ -98,7 +99,10 @@ def create(vm):
VIR_DOMAIN_START_BYPASS_CACHE = 4
VIR_DOMAIN_START_FORCE_BOOT = 8
'''
connection
.
createXML
(
vm
.
dump_xml
(),
libvirt
.
VIR_DOMAIN_START_PAUSED
)
vm
=
VMInstance
.
deserialize
(
vm_desc
)
# Setting proper hypervisor
vm
.
vm_type
=
os
.
getenv
(
HYPERVISOR_TYPE
,
"test"
)
connection
.
createXML
(
vm
.
dump_xml
(),
libvirt
.
VIR_DOMAIN_NONE
)
#, libvirt.VIR_DOMAIN_START_PAUSED)
logging
.
info
(
"Virtual machine
%
s is created from xml"
,
vm
.
name
)
...
...
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