I think you need to include the "accessMask" in your "hostAccess" .  So for a production access to a LUN you would need:  my $body = '{"name":"'.$lun_name.'","lunParameters":{"pool":{"id":"pool_2"},"size":'.$lun_size.',"isThinEnabled":"false","hostAccess":[{"host":{"id": "Host_6"},"accessMask": 1}]}}';
Hi everyone,   I'm trying to script LUN creation for Unity 500 with the REST API, but i have some issue with hostAccess configuration. I tried to follow the apidocs on the [URL] but i think i missed how this api work.  I can create a simple LUN with : my $body = '{"name":"'.$lun_name.'","lunParameters":{"pool":{"id":"pool_2"},"size":'.$lun_size.',"isThinEnabled":"false"}}'; $client->POST("/api/types/storageResource/action/createLun", $body);  But when i want to add the hostAccess configuration i have this following error :  "httpStatusCode":422,"messages":[{"en-US":"The LUN or consistency group host access parameter is invalid. (Error Code:0x6701026)"}]  The body request was :  my $body = '{"name":"'.$lun_name.'","lunParameters":{"pool":{"id":"pool_2"},"size":'.$lun_size.',"isThinEnabled":"false","hostAccess":[{"host":{"id":"Host_6"}}]}}';  Thanks for your help
Unity REST API hostAccess