Method: OneviewSDK::API200::ServerProfile#add_volume_attachment
- Defined in:
- lib/oneview-sdk/resource/api200/server_profile.rb
#add_volume_attachment(volume, attachment_options = {}) ⇒ Object
Adds volume attachment entry with associated Volume in Server profile
198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/oneview-sdk/resource/api200/server_profile.rb', line 198 def (volume, = {}) raise IncompleteResource, 'Volume not found!' unless volume.retrieve! # Convert symbols keys to string = Hash[.map { |k, v| [k.to_s, v] }] self['sanStorage'] ||= {} self['sanStorage']['volumeAttachments'] ||= [] self['sanStorage']['manageSanStorage'] ||= true ['id'] ||= 0 ['volumeUri'] = volume['uri'] ['volumeStoragePoolUri'] = volume['storagePoolUri'] ['volumeStorageSystemUri'] = volume['storageSystemUri'] self['sanStorage']['volumeAttachments'] << end |