Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted (trashed) instances are not persistified #536

Closed
ricab opened this issue Dec 14, 2018 · 2 comments
Closed

Deleted (trashed) instances are not persistified #536

ricab opened this issue Dec 14, 2018 · 2 comments
Assignees
Labels

Comments

@ricab
Copy link
Collaborator

ricab commented Dec 14, 2018

$ sudo ./bin/multipassd 
^Z
[3]+  Stopped                 sudo ./bin/multipassd
 $ bg
[3]+ sudo ./bin/multipassd &
 $ multipass list
Name                    State             IPv4             Release
relative-rockhopper     STOPPED           --               Ubuntu 16.04 LTS
sleek-cobra             STOPPED           --               Ubuntu 16.04 LTS
admissible-mudskipper   STOPPED           --               Ubuntu 16.04 LTS
 $ multipass delete --all
 $ multipass list
Name                    State             IPv4             Release
admissible-mudskipper   DELETED           --               Not Available
relative-rockhopper     DELETED           --               Not Available
sleek-cobra             DELETED           --               Not Available
 $ fg
sudo ./bin/multipassd
^C[warning] [Qt] "No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/NetworkManager/ActiveConnection/29"
[...]
 $ echo "multipassd just quit, let's restart..."
multipassd just quit, let's restart...
 $ sudo ./bin/multipassd 
^Z
[3]+  Stopped                 sudo ./bin/multipassd
 $ bg
[3]+ sudo ./bin/multipassd &
 $ multipass list
Name                    State             IPv4             Release
relative-rockhopper     STOPPED           --               Ubuntu 16.04 LTS
sleek-cobra             STOPPED           --               Ubuntu 16.04 LTS
admissible-mudskipper   STOPPED           --               Ubuntu 16.04 LTS
@ricab ricab added the bug label Dec 14, 2018
@ricab ricab self-assigned this Dec 18, 2018
@ricab
Copy link
Collaborator Author

ricab commented Dec 19, 2018

We currently don't have delete as part of internal states, even though we treat it as a state for many purposes, including user interface. Two important implications:

  1. We need special code branches to deal with "deleted"
  2. We don't persistify deleted instances (this issue)

I am therefore adding the corresponding enum entry to deal with both points. Item 1 above will be mitigated but not completely removed, as deleted (trashed) VMs are still kept in a separate collection.

@ricab
Copy link
Collaborator Author

ricab commented Dec 20, 2018

The plan changed after a bit of discussion. Since we want to be able to recover instances to different states in the future (see #549), we will eventually need to persistify an additional piece of information.

The code already stores the deleted "state" independently, freeing the state attribute to store what state to go back to on recover (or, equivalently, the state before delete). It is easier to keep that and just store an additional flag indicating whether the instance had been deleted.

ricab added a commit to ricab/multipass that referenced this issue Dec 21, 2018
bors bot added a commit that referenced this issue Jan 7, 2019
553: Persistify deleted state and load it on daemon startup. r=townsend2010 a=ricab

Fixes #536. This adds a boolean field to each instance specification indicating whether or not it is deleted. 

This change is backward compatible: the daemon can still load VM specs that do not contain the new flag. Such VMs are regarded as not deleted.

Co-authored-by: Ricardo Abreu <[email protected]>
@bors bors bot closed this as completed in #553 Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant