Commit 8e221583 by Őry Máté

add vmdirver.get_num_cores,get_ram_size

parent e2ae4438
celery==3.0.23 celery==3.0.23
decorator==3.4.0 decorator==3.4.0
lxml==3.2.3 lxml==3.2.3
psutil==1.1.3
...@@ -3,8 +3,12 @@ import libvirt ...@@ -3,8 +3,12 @@ import libvirt
import logging import logging
import os import os
import sys import sys
from vm import VMInstance
from decorator import decorator from decorator import decorator
from psutil import NUM_CPUS, virtual_memory
from vm import VMInstance
from vmcelery import celery, lib_connection from vmcelery import celery, lib_connection
sys.path.append(os.path.dirname(os.path.basename(__file__))) sys.path.append(os.path.dirname(os.path.basename(__file__)))
...@@ -492,6 +496,16 @@ def migrate(name, host, live=False): ...@@ -492,6 +496,16 @@ def migrate(name, host, live=False):
bandwidth=0) bandwidth=0)
# return _parse_info(domain.info()) # return _parse_info(domain.info())
@celery.task @celery.task
def ping(): def ping():
return True return True
@celery.task
def get_core_num():
return NUM_CPUS
@celery.task
def get_ram_size():
return virtual_memory().total
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment