Error "422" when using the New-UnityHostIPPort command
bananaphonee opened this issue · comments
I see the following error when I use the following command:
The array sends an error message:
Error code: 422
Error description: Unprocessable Entity
Error details: {"error":{"errorCode":5,"httpStatusCode":422,"messages":[{"en-US":"One or more speci
fied parameters are invalid. (Error Code:0x5)"}],"created":"2018-04-12T16:39:22.725Z"}}
Invoke-WebRequest : The remote server returned an error: (422) Unprocessable Entity.
At line:33 char:15
I do the following commands:
#Connection towards the server
$IP = Read-Host "Give the IP of the server"
Connect-Unity -Server $IP
#Creating a new Host
New-UnityHost -Name "Test2"
Get-UnityHost
#Creating a new Host IP Port
New-UnityHostIPPort "Host_7" -address 172.16.254.72 -netmask 255.255.255.0
I already have tried with "" and with '' at the -address and -netmask
I can connect to the server becaus when I create the Host I can look it up, the following is what I get when I do the Get-UnityHost.
Get-UnityHost
Id Name OsType Type
Host_7 Test2 HostManual
But when I do the last command then the I get the dialog screen if I am sure I want to create the Host IP Port, however when I click yes I get the "422" error.
Here is the output when I run it with -verbose:
PS C:\Users\lars> New-UnityHostIPPort "Host_7" -address "172.16.254.72" -netmask "255.255.255.0" -verbose
VERBOSE: GET https://172.16.254.114/api/types/system/instances with 0-byte payload
VERBOSE: received -1-byte response of content type application/json; version=1.0;charset=UTF-8
VERBOSE: GET https://172.16.254.114/api/types/host/instances?fields=hostIPPorts,tenant,hostUUID,isN
fsv4Supported,description,autoManageType,hostLUNs,lastPollTime,hostPolledUUID,hostPushedUUID,name,d
atastores,hostVVolDatastore,storageResources,registrationType,vms,nfsUsername,health,id,hostContain
er,fcHostInitiators,iscsiHostInitiators,osType,type&compact=true with 0-byte payload
VERBOSE: received -1-byte response of content type application/json; version=1.0;charset=UTF-8
VERBOSE: {
"host": {
"id": "Host_7"
},
"netmask": "255.255.255.0",
"address": "172.16.254.72"
}
VERBOSE: GET https://172.16.254.114/api/types/system/instances with 0-byte payload
VERBOSE: received -1-byte response of content type application/json; version=1.0;charset=UTF-8
VERBOSE: URL: https://172.16.254.114/api/types/hostIPPort/instances
VERBOSE: POST https://172.16.254.114/api/types/hostIPPort/instances with -1-byte payload
Here is the output for $PSVersionTable:
Name Value
PSVersion 5.1.14393.2125
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2125
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Please makes sure these boxes are checked before submitting your issue (put an X between the brackets).
- Check that your Powershell version > 5.0 (Bonus point if you are using the latest version available)
- Check that you follow the instructions for installing the module
Also, please provide:
- Any instructions that may help to reproduce the problem
- Informations about your host
$PSVerionTable
- The list of the loaded modules
Get-Module
Hello @bananaphonee
Thanks for opening an issue.
I'm not sure about this one because the documentation is not very explicit but, apparently, you can't provide a mask when you're adding an network address to a host. Mask are allowed only when you are creating a subnet...
Could you try by yourself ?
Hello @equelin
Thanks for the respons, I will try this next monday I can only access the server at the local place for security reasons.
I will let you know what the output is, and if it works then.
Hello @equelin
I have tested it like this:
New-UnityHostIPPort "Host_7" -address 172.16.254.72
And it works, thanks for the help
Good to know !