Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
db3ffeb2
authored
Sep 03, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
local celery manager for tracking tasks
parent
f3cf1fb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
manager/manager.py
+24
-2
No files found.
manager/manager.py
View file @
db3ffeb2
#!/usr/bin/env python
from
mancelery
import
celery
from
celery
import
current_task
import
scheduler
@celery.task
def
create_vm
(
):
def
deploy
(
instance
):
'''Create new virtual machine from VM class.
'''
# Get info from scheduler (free sapce, node with enough cpu and ram)
# Get info from scheduler (free space, node with enough cpu and ram)
current_task
.
update_state
(
state
=
'PENDING'
)
instance
.
node
=
scheduler
.
get_node
()
# Create hard drives (storage)
current_task
.
update_state
(
state
=
'PREPARE'
)
for
disk
in
instance
.
disks
:
disk
.
deploy
()
# Create context
instance
.
create_context
()
# Create machine (vmdriver)
current_task
.
update_state
(
state
=
'DEPLOY VM'
)
instance
.
deploy_task
()
# Estabilish network connection (vmdriver)
current_task
.
update_state
(
state
=
'DEPLOY NET'
)
instance
.
deploy_net
()
# Resume machine (vmdriver)
current_task
.
update_state
(
state
=
'BOOT'
)
instance
.
resume
()
pass
...
...
@@ -39,3 +57,7 @@ def restart():
def
reset
():
pass
def
migrate
():
pass
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