hpe-storage / python-3parclient

This is a python client that talks to the HPE Alletra 9000 and HPE Primera and HPE 3PAR storage array via REST.
Apache License 2.0
48 stars 70 forks source link

exception received when creating vlun #73

Open mirokosa opened 5 years ago

mirokosa commented 5 years ago

When creating vLUN using autoLUN option an error is thrown:

hpe3parclient.exceptions.HTTPConflict: Conflict (HTTP 409) 99 - invalid operation: LUN number and persona capability conflict

This is caused in specific cases:

  1. host persona VMware 11 is used
  2. LUN IDs 0-255 are used.

Root cause is introduction of PE LUN for host persona VMware 11 (LUN ID). Since HPE didn't provide a fix yet for 3PAR OS, we would like to as for enhancement of 3PARclient code in following way for autoLUN option.

1step. autoLun = True lun=0 maxAutoLun=0

if receive error "Conflict (HTTP 409) 99 - invalid operation: LUN number and persona capability conflict" ignore error and continue 2step

2step. autoLun = True lun=257 maxAutoLun=0

thanks, Miro

wantdrink commented 5 years ago
def createVLUN(self, volumeName, lun=None, hostname=None, portPos=None,
               noVcn=None, overrideLowerPriority=None, auto=False):

If auto = True, the info['lun'] will be set as zero, and maxAutoLun will be set as zero, which means no max. The vlun will be created with the lun number between 0 and max.

Current code:

if auto: info['autoLun'] = True info['maxAutoLun'] = 0 info['lun'] = 0

Can we change it to:

if auto: info['autoLun'] = True info['maxAutoLun'] = 0 info['lun'] = 0 if not lun else lun

This way if user call the method as:

createVLUN(volumeName=vv_name, hostname=host, auto=True, lun=257)

The client will create vlun with the lun number start with 257 to max.

And if user call the method as:

createVLUN(volumeName=vv_name, hostname=host, auto=True)

The client will create vlun with the lun number start with 0 to max.