Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3616ce21
authored
Sep 09, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing emulator from hardcoded to parameter
parent
1170966d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
17 deletions
+5
-17
miscellaneous/vmcelerey.conf
+0
-15
vm.py
+5
-2
No files found.
miscellaneous/vmcelerey.conf
deleted
100644 → 0
View file @
1170966d
description
"IK Cloud Django Development Server"
start
on
runlevel
[
2345
]
stop
on
runlevel
[!
2345
]
respawn
respawn
limit
30
30
setuid
cloud
chdir
/
home
/
cloud
/
vmdriver
script
. /
home
/
cloud
/.
virtualenvs
/
vmdriver
/
local
/
bin
/
postactivate
exec
/
home
/
cloud
/.
virtualenvs
/
vmdriver
/
bin
/
celery
-
A
vmcelery
worker
--
loglevel
=
info
> /
home
/
cloud
/
log
end
script
vm.py
View file @
3616ce21
...
@@ -20,6 +20,7 @@ class VMInstance:
...
@@ -20,6 +20,7 @@ class VMInstance:
name
,
name
,
vcpu
,
vcpu
,
memory_max
,
memory_max
,
emulator
=
'/usr/bin/kvm'
,
memory
=
None
,
memory
=
None
,
cpu_share
=
100
,
cpu_share
=
100
,
arch
=
"x86_64"
,
arch
=
"x86_64"
,
...
@@ -49,6 +50,7 @@ class VMInstance:
...
@@ -49,6 +50,7 @@ class VMInstance:
seclabel_mode - libvirt security mode (selinux, apparmor)
seclabel_mode - libvirt security mode (selinux, apparmor)
'''
'''
self
.
name
=
name
self
.
name
=
name
self
.
emulator
=
emulator
self
.
vcpu
=
vcpu
self
.
vcpu
=
vcpu
self
.
cpu_share
=
cpu_share
self
.
cpu_share
=
cpu_share
self
.
memory_max
=
memory_max
self
.
memory_max
=
memory_max
...
@@ -70,7 +72,8 @@ class VMInstance:
...
@@ -70,7 +72,8 @@ class VMInstance:
@classmethod
@classmethod
def
deserialize
(
cls
,
desc
):
def
deserialize
(
cls
,
desc
):
desc
[
'disk_list'
]
=
[
VMDisk
.
deserialize
(
d
)
for
d
in
desc
[
'disk_list'
]]
desc
[
'disk_list'
]
=
[
VMDisk
.
deserialize
(
d
)
for
d
in
desc
[
'disk_list'
]]
desc
[
'network_list'
]
=
[
VMNetwork
.
deserialize
(
n
)
for
n
in
desc
[
'network_list'
]]
desc
[
'network_list'
]
=
[
VMNetwork
.
deserialize
(
n
)
for
n
in
desc
[
'network_list'
]]
return
cls
(
**
desc
)
return
cls
(
**
desc
)
def
build_xml
(
self
):
def
build_xml
(
self
):
...
@@ -98,7 +101,7 @@ class VMInstance:
...
@@ -98,7 +101,7 @@ class VMInstance:
'enable'
:
"yes"
if
self
.
boot_menu
else
"no"
})
'enable'
:
"yes"
if
self
.
boot_menu
else
"no"
})
# Devices
# Devices
devices
=
ET
.
SubElement
(
xml_top
,
'devices'
)
devices
=
ET
.
SubElement
(
xml_top
,
'devices'
)
ET
.
SubElement
(
devices
,
'emulator'
)
.
text
=
'/usr/bin/kvm'
ET
.
SubElement
(
devices
,
'emulator'
)
.
text
=
self
.
emulator
for
disk
in
self
.
disk_list
:
for
disk
in
self
.
disk_list
:
devices
.
append
(
disk
.
build_xml
())
devices
.
append
(
disk
.
build_xml
())
for
network
in
self
.
network_list
:
for
network
in
self
.
network_list
:
...
...
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