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
104ebd1a
authored
Apr 25, 2016
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small fix
parent
bc83f8c2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
14 deletions
+3
-14
ceph.py
+0
-3
vm.py
+1
-6
vmdriver.py
+2
-5
No files found.
ceph.py
View file @
104ebd1a
...
...
@@ -36,10 +36,7 @@ class CephConnection:
def
sudo
(
*
args
):
try
:
subprocess
.
check_output
([
"/bin/sudo"
]
+
list
(
args
))
except
subprocess
.
CalledProcessError
as
e
:
raise
Exception
(
e
)
def
map_rbd
(
ceph_path
,
local_path
):
...
...
vm.py
View file @
104ebd1a
...
...
@@ -241,14 +241,9 @@ class VMDisk(object):
class
CephVMDisk
(
VMDisk
):
'''
Virtual MAchine disk over Ceph block representing class
'''
Class representing Virtual Machine disk over a Ceph block device
'''
hosts
=
None
protocol
=
None
ceph_user
=
None
secret_uuid
=
None
def
__init__
(
self
,
source
,
hosts
,
...
...
vmdriver.py
View file @
104ebd1a
...
...
@@ -318,7 +318,6 @@ def suspend(name):
Return the domain info dict.
"""
domain
=
lookupByName
(
name
)
domain
.
suspend
()
return
_parse_info
(
domain
.
info
())
...
...
@@ -333,7 +332,7 @@ def save(name, data_store_type, dir, filename):
if
data_store_type
==
"ceph_block"
:
ceph
.
save
(
domain
,
dir
,
filename
)
else
:
path
=
dir
+
"/"
+
filename
path
=
os
.
path
.
join
(
dir
,
filename
)
domain
.
save
(
path
)
...
...
@@ -351,7 +350,7 @@ def restore(name, data_store_type, dir, filename):
if
data_store_type
==
"ceph_block"
:
ceph
.
restore
(
Connection
.
get
(),
dir
,
filename
)
else
:
path
=
dir
+
"/"
+
filename
path
=
os
.
path
.
join
(
dir
,
filename
)
Connection
.
get
()
.
restore
(
path
)
return
domain_info
(
name
)
...
...
@@ -564,7 +563,6 @@ def migrate(name, host, live=False):
def
attach_disk
(
name
,
disk_desc
):
""" Attach Disk to a running virtual machine. """
domain
=
lookupByName
(
name
)
disk
=
None
if
disk_desc
[
"data_store_type"
]
==
"ceph_block"
:
disk
=
CephVMDisk
.
deserialize
(
disk_desc
)
else
:
...
...
@@ -578,7 +576,6 @@ def attach_disk(name, disk_desc):
def
detach_disk
(
name
,
disk_desc
):
""" Detach disk from a running virtual machine. """
domain
=
lookupByName
(
name
)
disk
=
None
if
disk_desc
[
"data_store_type"
]
==
"ceph_block"
:
disk
=
CephVMDisk
.
deserialize
(
disk_desc
)
else
:
...
...
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