-
Notifications
You must be signed in to change notification settings - Fork 37
Implement MountSnapshotJob / UnmountSnapshotJob #2156
Conversation
It works like this:
|
@jgrund dependencies and locks are missing, but I wanted to clarify if the approach taken is correct with respect to "DB calls should be made in Rust" as specified in the issue. Since the state machine stays in Python and we need to save the |
Yes, I'm more talking about associated queries needed to get related objects. |
I've tested this with non-imported pools and no dependencies were necessary besides |
At the very least the filesystem needs to be in the available state. Mounting a snapshot should not work if the fs is unavailable I think |
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
Signed-off-by: Michael Pankov <work@michaelpankov.com>
So, I've retested everything.
|
Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
# To prevent circular imports | ||
from chroma_core.models.filesystem import ManagedFilesystem | ||
|
||
return DependOn(ManagedFilesystem.objects.get(name=self.fsname), "available") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to check if this is needed for ldiskfs since it's apparently not needed with zfs
@@ -1785,6 +1785,37 @@ class NoNidsPresent(Exception): | |||
pass | |||
|
|||
|
|||
class CreateSnapshotJob(Job): | |||
fqdn = models.CharField(max_length=256, help_text="MGS host to create the snapshot on") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine for now but in the future, we will have a local action plugin that we can call to get the fqdn of the MGS node.
@@ -196,4 +196,8 @@ | |||
"revoke_ticket": "Revoking Ticket", | |||
"forget_ticket": "Forgetting Ticket", | |||
"create_task": "Creating Task", | |||
"mount_snapshot": "Mounting Snapshot", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really a big deal but the long descriptions are shorter than the standard descriptions. You could store the values that you have under description
in this help.py file and then call them:
@classmethod
def long_description(cls, stateful_object):
return help_text["unmount_snapshot"] % stateful_object.fqdn
def description(self):
return self.long_description(self)
Signed-off-by: Michael Pankov work@michaelpankov.com
This change is