HPE OneView

Attach Volumes to serverProfile using POSH 1.2 library

Occasional Collector

Attach Volumes to serverProfile using POSH 1.2 library


Oneiew version - 1.2

Powershell library version - 1.2

I am trying to attach existing volumes to existing server-profiles.

I have used the below commands in order till now:


$a = send-hpovrequest "/rest/server-profiles/csdsd-0000-XXXX-XXXX-XXXXXXX"

$volume1 = Get-HPOVStorageVolume XXX_XXX_SAN_012_XX | New-HPOVProfileAttachVolume -VolumeID 12

 $a.sanStorage.volumeAttachments = $a.sanStorage.volumeAttachments + $volume1


The output of $a.sanStorage.volumeAttachments is as below. Volume 12 is in the powershell object array. But I am not sure how to set the volume to the profile so it's status is attached like volume 11 in the snippet below:


storagePaths           : {@{storageTargetType=Auto; storageTargets=System.Object[]; connectionId=2; isEnabled=True;
                         status=OK}, @{storageTargetType=Auto; storageTargets=System.Object[]; connectionId=1;
                         isEnabled=True; status=OK}}
state                  : Attached
volumeUri              : /rest/storage-volumes/XXX-XXXX-XXXX-XXXXX
volumeStoragePoolUri   : /rest/storage-pools/XXXX-XXX-XXX-8B83-XXXXX
volumeStorageSystemUri : /rest/storage-systems/XXXXX
lun                    : 11
lunType                : Manual
status                 : OK
id                     : 11

 id                     : 12
volumeUri              : /rest/storage-volumes/XXX-XXX-XXXX-XXX
volumeStoragePoolUri   : /rest/storage-pools/XXX-XXX-XXX-XXXX
volumeStorageSystemUri : /rest/storage-systems/XXXX
lunType                : Auto
storagePaths           : {}

 I used :

Set-HPOVResource $a

But that did not attach volume12 to the profile. As can be seen in volume 11, storage path and state is not set for volume12.

 Any help appreciated. Thanks




Re: Attach Volumes to serverProfile using POSH 1.2 library

Can you please submit an issue over at the HPE OneView PowerShell LIbrary GitHub repo?  That way, I can track the request?  I'm in the process of updating New-HPOVServerProfileVolumeAttach to support a Server Profile object, and will attach volume(s) to it, instead of just being a helper Cmdlet it is today.

I am an HPE employee

Accept or Kudo