deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH] FGCP: exclude system disks from storage_volumes and cimi system volumes. DTACLOUD-532.
Date Mon, 08 Apr 2013 08:47:37 GMT
On 04/06/2013 01:06 PM, diesk@fast.au.fujitsu.com wrote:

ACK.

> From: Dies Koper <diesk@fast.au.fujitsu.com>
>
> ---
>   server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb              | 7 ++++---
>   server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb | 2 +-
>   2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> index 436cb50..9ca65c6 100644
> --- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> +++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
> @@ -516,7 +516,8 @@ class FgcpDriver < Deltacloud::BaseDriver
>                 vdisks['vdisk'].each do |vdisk|
>
>                   #state requires an additional call per volume. Only set if attached.
> -                #exclude system disks as they are not detachable?
> +                #exclude system disks as they are instance disks, not volumes
> +                kind = determine_storage_type(vdisk['vdiskId'][0])
>                   volumes << StorageVolume.new(
>                     :id          => vdisk['vdiskId'][0],
>                     :name        => vdisk['vdiskName'][0],
> @@ -524,9 +525,9 @@ class FgcpDriver < Deltacloud::BaseDriver
>                     :instance_id => vdisk['attachedTo'].nil? ? nil : vdisk['attachedTo'][0],
>                     :realm_id    => client.extract_vsys_id(vdisk['vdiskId'][0]),
>                     # aligning with rhevm, which returns 'system' or 'data'
> -                  :kind        => determine_storage_type(vdisk['vdiskId'][0]),
> +                  :kind        => kind,
>                     :state       => vdisk['attachedTo'].nil? ? 'AVAILABLE' : 'IN-USE'
> -                )
> +                ) unless kind == 'system'
>                 end
>               end
>             rescue Exception => ex # cater for case where vsys was just destroyed
since list_vsys call
> diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
> index 352f9a7..490a085 100644
> --- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
> +++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
> @@ -170,7 +170,7 @@ module Deltacloud::Drivers::Fgcp
>               :id      => context.system_volume_url(:id => vsys_id, :ent_id =>
vdisk_id),
>               :name    => vdisk['vdiskName'][0],
>               :volume  => { :href => context.volume_url(vdisk_id)}
> -          ) unless opts[:id] and opts[:id] != vdisk_id
> +          ) unless (opts[:id] and opts[:id] != vdisk_id) or determine_storage_type(vdisk_id)
== 'system'
>           end
>           volumes.compact
>         end
>


-- 

Michal Fojtik <mfojtik@redhat.com>
Deltacloud API, CloudForms

Mime
View raw message