Adding option --devices to backup operation #994
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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