rackspace-cookbooks / rackspacecloud

LWRPs for Rackspace Cloud APIs
Apache License 2.0
10 stars 17 forks source link

snapshot_id #35

Open Paladin opened 9 years ago

Paladin commented 9 years ago

The ability to create a volume (CBS) from a snapshot was removed when the delete actions were added. Is there a reason for this, beyond the fact that you can't delete a volume with snapshots until you delete the snapshots? It's a quite useful function, essentially to clone an existing volume, when building servers to test ideas before putting them into production, and I hate to have it removed simply because of the link between volumes and snapshots.

martinb3 commented 9 years ago

Hi there -- I'll defer to @stevendgonzales on this one, as it looks like he was the one working on that code. For what it's worth, it looks like the functionality was only in master for about 5 days at most, as part of a bunch of refactoring commits.

Paladin commented 9 years ago

Haven't managed to get the tests to run yet (keeps running into a permissions issue, probably a local artifact) but from some experimentation with the cloning function (source_volid attribute on the creation) create_and_attach suffers from the fact that the creation returns success while the data on the drive is still being cloned, leading to an error:

Invalid volume: volume '' status must be 'available'. Currently in 'creating'

and the prospect of pausing everything for several minutes (5-10 minutes for a 50GB SSD) might be daunting for some. Still, it's early days in my experimentation. I think I'll fork and create a branch that does this (because the potential wait doesn't bother me, it's fairly well defined for what I'm using it for) and test it as soon as I can get any of the tests running in my environment.

Ideally I'd rather use a snapshot, simply because the process allows for more data integrity than the clone, but I started by experimenting with the clone because building from a snapshot takes twice as long. Oddly enough, though, create_and_attach using snapshot_id worked, despite that.

Paladin commented 9 years ago

OK, after some experimentation (tests are still failing with a permissions error for me, so no luck there) I have the snapshot_id working after some tweaks. Biggest issue was extending a timeout value for the looooong time it takes to build from a snapshot. Once I can get the tests working I'll be more sure it actually works.