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
8907de3f
authored
Aug 09, 2016
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vmdriver, ceph: change dump size limit to ram size
parent
032250b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
ceph.py
+2
-4
vmdriver.py
+2
-2
No files found.
ceph.py
View file @
8907de3f
...
...
@@ -14,8 +14,6 @@ from util import req_connection, wrap_libvirtError, Connection
logger
=
logging
.
getLogger
(
__name__
)
DUMP_SIZE_LIMIT
=
int
(
os
.
getenv
(
"DUMP_SIZE_LIMIT"
,
20
*
1024
**
3
))
# 20GB
mon_regex_ipv6
=
re
.
compile
(
r"^\[(?P<address>.+)\]\:(?P<port>\d+).*$"
)
mon_regex_ipv4
=
re
.
compile
(
r"^(?P<address>.+)\:(?P<port>\d+).*$"
)
...
...
@@ -109,12 +107,12 @@ def get_endpoints(user):
return
_get_endpoints
(
conf
)
def
save
(
domain
,
poolname
,
diskname
,
user
):
def
save
(
domain
,
poolname
,
diskname
,
ram_size
,
user
):
diskname
=
str
(
diskname
)
poolname
=
str
(
poolname
)
ceph_path
=
os
.
path
.
join
(
poolname
,
diskname
)
local_path
=
os
.
path
.
join
(
"/dev/rbd"
,
ceph_path
)
disk_size
=
DUMP_SIZE_LIMIT
disk_size
=
(
ram_size
+
100
)
*
1024
**
2
# +100MB provision
with
CephConnection
(
poolname
,
user
=
user
)
as
conn
:
rbd_inst
=
rbd
.
RBD
()
...
...
vmdriver.py
View file @
8907de3f
...
...
@@ -227,11 +227,11 @@ def suspend(name):
@celery.task
@req_connection
@wrap_libvirtError
def
save
(
name
,
data_store_type
,
dir
,
filename
,
ceph_user
=
None
):
def
save
(
name
,
data_store_type
,
dir
,
filename
,
ram_size
,
ceph_user
=
None
):
""" Stop virtual machine and save its memory to path. """
domain
=
lookupByName
(
name
)
if
data_store_type
==
"ceph_block"
:
ceph
.
save
(
domain
,
dir
,
filename
,
ceph_user
)
ceph
.
save
(
domain
,
dir
,
filename
,
ram_size
,
ceph_user
)
else
:
path
=
os
.
path
.
join
(
dir
,
filename
)
domain
.
save
(
path
)
...
...
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