Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cf6e76c1
authored
Jul 21, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style, disk
parent
e837067b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
4 deletions
+29
-4
circle/dashboard/templates/dashboard/_disk-list-element.html
+3
-0
circle/storage/migrations/0004_disk_ci_disk.py
+18
-0
circle/storage/models.py
+1
-1
circle/vm/operations.py
+7
-3
No files found.
circle/dashboard/templates/dashboard/_disk-list-element.html
View file @
cf6e76c1
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
{% load sizefieldtags %}
{% load sizefieldtags %}
<i
class=
"fa fa-file"
></i>
<i
class=
"fa fa-file"
></i>
{% if d.ci_disk %}
<i
class=
"fa fa-cloud-upload"
></i>
{% endif %}
{{ d.name }} (#{{ d.id }}) - {{ d.size|filesize }}
{{ d.name }} (#{{ d.id }}) - {{ d.size|filesize }}
...
...
circle/storage/migrations/0004_disk_ci_disk.py
0 → 100644
View file @
cf6e76c1
# Generated by Django 3.2.3 on 2022-07-21 14:48
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'storage'
,
'0003_auto_20200424_2000'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'disk'
,
name
=
'ci_disk'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
]
circle/storage/models.py
View file @
cf6e76c1
...
@@ -144,7 +144,7 @@ class Disk(TimeStampedModel):
...
@@ -144,7 +144,7 @@ class Disk(TimeStampedModel):
dev_num
=
CharField
(
default
=
'a'
,
max_length
=
1
,
dev_num
=
CharField
(
default
=
'a'
,
max_length
=
1
,
verbose_name
=
_
(
"device number"
))
verbose_name
=
_
(
"device number"
))
destroyed
=
DateTimeField
(
blank
=
True
,
default
=
None
,
null
=
True
)
destroyed
=
DateTimeField
(
blank
=
True
,
default
=
None
,
null
=
True
)
ci_disk
=
BooleanField
(
default
=
False
)
is_ready
=
BooleanField
(
default
=
False
)
is_ready
=
BooleanField
(
default
=
False
)
class
Meta
:
class
Meta
:
...
...
circle/vm/operations.py
View file @
cf6e76c1
...
@@ -436,7 +436,13 @@ class DeployOperation(InstanceOperation):
...
@@ -436,7 +436,13 @@ class DeployOperation(InstanceOperation):
else
:
else
:
self
.
instance
.
allocate_node
()
self
.
instance
.
allocate_node
()
if
self
.
instance
.
cloud_init
:
init_disk
=
None
try
:
init_disk
=
self
.
instance
.
disks
.
get
(
ci_disk
=
True
)
except
:
logger
.
debug
(
'create init-disk'
)
if
self
.
instance
.
cloud_init
and
init_disk
==
None
:
self
.
instance
.
_create_ci_image
(
parent_activity
=
activity
)
self
.
instance
.
_create_ci_image
(
parent_activity
=
activity
)
# Deploy virtual images
# Deploy virtual images
...
@@ -491,7 +497,6 @@ class DeployOperation(InstanceOperation):
...
@@ -491,7 +497,6 @@ class DeployOperation(InstanceOperation):
id
=
"_create_ci_image"
id
=
"_create_ci_image"
name
=
_
(
"create cloud-init image"
)
name
=
_
(
"create cloud-init image"
)
description
=
_
(
"create cloud init iso from user and meta-data"
)
description
=
_
(
"create cloud init iso from user and meta-data"
)
acl_level
=
"owner"
def
_operation
(
self
,
user
,
activity
,
name
=
None
):
def
_operation
(
self
,
user
,
activity
,
name
=
None
):
logger
.
info
(
'create ci image'
)
logger
.
info
(
'create ci image'
)
...
@@ -500,7 +505,6 @@ class DeployOperation(InstanceOperation):
...
@@ -500,7 +505,6 @@ class DeployOperation(InstanceOperation):
disk
.
full_clean
()
disk
.
full_clean
()
disk
.
save
()
disk
.
save
()
self
.
instance
.
disks
.
add
(
disk
)
self
.
instance
.
disks
.
add
(
disk
)
# self.instance._attach_disk(disk=disk, parent_activity=activity)
@register_operation
@register_operation
class
DeployDisksOperation
(
SubOperationMixin
,
InstanceOperation
):
class
DeployDisksOperation
(
SubOperationMixin
,
InstanceOperation
):
...
...
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