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
c5826e9f
authored
Apr 08, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add option to save instance as template with integrated shutdown
parent
cb83f2ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
circle/vm/models/instance.py
+0
-5
circle/vm/operations.py
+5
-1
No files found.
circle/vm/models/instance.py
View file @
c5826e9f
...
@@ -815,11 +815,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
...
@@ -815,11 +815,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
self
.
node
=
None
self
.
node
=
None
self
.
vnc_port
=
None
self
.
vnc_port
=
None
def
shutdown_and_save_as_template
(
self
,
name
,
user
=
None
,
task_uuid
=
None
,
**
kwargs
):
self
.
shutdown
(
user
=
user
)
self
.
save_as_template
(
name
,
user
=
user
,
**
kwargs
)
def
get_status_icon
(
self
):
def
get_status_icon
(
self
):
return
{
return
{
'NOSTATE'
:
'icon-rocket'
,
'NOSTATE'
:
'icon-rocket'
,
...
...
circle/vm/operations.py
View file @
c5826e9f
...
@@ -247,7 +247,11 @@ class SaveAsTemplateOperation(InstanceOperation):
...
@@ -247,7 +247,11 @@ class SaveAsTemplateOperation(InstanceOperation):
Users can instantiate Virtual Machines from Templates.
Users can instantiate Virtual Machines from Templates.
"""
)
"""
)
def
_operation
(
self
,
activity
,
name
,
user
,
system
,
timeout
=
300
,
**
kwargs
):
def
_operation
(
self
,
activity
,
name
,
user
,
system
,
timeout
=
300
,
with_shutdown
=
True
,
**
kwargs
):
if
with_shutdown
:
ShutdownOperation
(
self
.
instance
)
.
call
(
parent_activity
=
activity
,
user
=
user
)
# prepare parameters
# prepare parameters
params
=
{
params
=
{
'access_method'
:
self
.
instance
.
access_method
,
'access_method'
:
self
.
instance
.
access_method
,
...
...
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