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

Adding option --devices to backup operation #994

Merged
merged 3 commits into from Sep 4, 2018

Conversation

amemni
Copy link
Contributor

@amemni amemni commented Aug 24, 2018

Adding a --devices option to the backup operation would be useful to avoid taking backups of devices that aren't needed to, like root volumes in EC2 and GCE, with a consecutive cost saving. This is already the case for the restore operation and it was done the same way here.

This was tested for EC2 and GCE (it seems like adding the --devices arg parser will require doing the change for all ec2.py, gce.py and azure_vm.py). Thanks.
$ nixops backup -d gcp-environment --devices n-54ac0d1963df11e886810a29f7962a18-frontend-data frontend.> backing up GCE machine 'n-54ac0d1963df11e886810a29f7962a18-frontend' using ID '20180824095544' frontend.> initiating snapshotting of disk 'n-54ac0d1963df11e886810a29f7962a18-frontend-data': 'backup-20180824095544-e886810a29f7962a18-frontend-data' frontend.> . done 20180824095544

$ nixops backup -d ec2-environment --devices /dev/xvdg deploy.......> backing up machine ‘deploy’ using id ‘20180824090046’ deploy.......> - /dev/xvdg deploy.......> + created snapshot of volume ‘vol-0a74338263b9bfda2’: ‘snap-0a58c587da879156c’ 20180824090046

@amemni
Copy link
Contributor Author

amemni commented Aug 24, 2018

-- cc @AmineChikhaoui @Chakerbh

self.connect()

self.log("backing up machine ‘{0}’ using id ‘{1}’".format(self.name, backup_id))
for d in devices:
self.log(" - {0}".format(d))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem very useful right ? was this for debugging purposes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't needed and it can be deleted, I did that to follow the same behavior from the restore function. Thanks.
def restore(self, defn, backup_id, devices=[]): self.stop()
self.log("restoring machine ‘{0}’ to backup ‘{1}’".format(self.name, backup_id)) for d in devices: self.log(" - {0}".format(d)

@AmineChikhaoui AmineChikhaoui merged commit e4324e4 into NixOS:master Sep 4, 2018
@amemni amemni deleted the add-backup-devices branch January 24, 2019 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants