deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH] FGCP: added support for storage_volume creation from snapshot
Date Sat, 23 Feb 2013 00:05:42 GMT
On Fri, 2013-02-22 at 12:11 +1100, diesk@fast.au.fujitsu.com wrote:
> From: Dies Koper <diesk@fast.au.fujitsu.com>
> 
> ---
>  server/lib/deltacloud/drivers/fgcp/fgcp_client.rb | 44 +++++++++++++++++++++++
>  server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb | 38 +++++++++++++++++++-
>  server/views/storage_volumes/show.html.haml       |  2 +-
>  3 files changed, 82 insertions(+), 2 deletions(-)

ACK; though there are a couple of things that need improving: (1) the
fact that there are no unit tests and (2) spawning a new thread for the
snapshot creation:

> diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> index 71b53bd..8d29a8e 100644
> --- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> +++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> @@ -556,7 +556,43 @@ class FgcpDriver < Deltacloud::BaseDriver
> +        #wait until creation completes in a separate thread
> +        Thread.new {
> +          attempts = 0
> +          begin
> +            sleep 10
> +            # this fails if the destination vdisk is still being deployed
> +            client.external_restore_vdisk(orig_vsys_id, backup_id, opts[:realm_id],
vdisk_id, key)

One question about this is more an FGCP API question: since snapshot
creation is so heavily asynchronous, snapshots may be very different
from the state the disk was in when the snapshot request was made.

The other issue is more serious: this makes it possible for users to
spawn a thread on every request, and is likely a way to trigger a DOS.
It would be _much_ preferrable to stick this into a work queue - it
wouldn't be all that hard to pull in DelayedJob for this purpose. I'd be
fine with adding a table to the DB to store these jobs.

David



Mime
View raw message