- This topic has 2 replies, 3 voices, and was last updated May 13, 2017 by Ted B.
Creating a VPG – Build 050121007
-
Andrew RFebruary 21, 2017 01:52:44 AM
I’m trying to create a VPG using REST API.
Using Powershell the script keeps failing to commit when the script attempts to commit.
https://192.168.4.20:9669/v1/vpgSettings
Exception : System.Net.WebException: The remote server returned an error: (400) Bad Request. at Microsoft.PowerShell.Commands.WebRequestPSCmdlet. GetResponse(WebRequest request) at Microsoft.PowerShell.Commands.WebRequestPSCmdlet. ProcessRecord() TargetObject : System.Net.HttpWebRequest CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Comm ands.InvokeRestMethodCommand ErrorDetails : {"Message":"Limit in MB value must be assigned"} InvocationInfo : System.Management.Automation.InvocationInfo
Using postman I can successfully post vpgSettings using the following JSON string
{ "Backup": null, "Basic": { "JournalHistoryInHours": null, "Name": "K2TEST", "Priority": "Medium", "ProtectedSiteIdentifier": "bfcf5cc1-1afc-4663-99e9-344f79854f43", "RecoverySiteIdentifier": "3c8a27a1-7d9d-4d76-a01c-dbc8954a309c", "RpoInSeconds": null, "ServiceProfileIdentifier": "", "TestIntervalInMinutes": null, "UseWanCompression": true, "ZorgIdentifier": null }, "BootGroups": { "BootGroups": [ { "BootDelayInSeconds": 0, "BootGroupIdentifier": "00000000-0000-0000-0000-000000000000", "Name": "Default" } ] }, "Journal": { "DatastoreClusterIdentifier": null, "DatastoreIdentifier": "1dc6a571-220e-48e9-b136-b23e18a8cca0.datastore-157", "Limitation":{ "HardLimitInMB":null, "HardLimitInPercent":null, "WarningThresholdInMB":null, "WarningThresholdInPercent":null } }, "Networks": { "Failover":{ "Hypervisor":{ "DefaultNetworkIdentifier":"1dc6a571-220e-48e9-b136-b23e18a8cca0.dvportgroup-145" } }, "FailoverTest":{ "Hypervisor":{ "DefaultNetworkIdentifier":"1dc6a571-220e-48e9-b136-b23e18a8cca0.dvportgroup-214" } } }, "Recovery": { "DefaultDatastoreIdentifier":"1dc6a571-220e-48e9-b136-b23e18a8cca0.datastore-157", "DefaultFolderIdentifier":"1dc6a571-220e-48e9-b136-b23e18a8cca0.group-v207", "DefaultHostClusterIdentifier":"1dc6a571-220e-48e9-b136-b23e18a8cca0.domain-c7", "DefaultHostIdentifier":null, "ResourcePoolIdentifier":null }, "Scripting": { "PostBackup": null, "PostRecovery": { "Command": null, "Parameters": null, "TimeoutInSeconds": 0 }, "PreRecovery": { "Command": null, "Parameters": null, "TimeoutInSeconds": 0 } }, "Vms": [{"VmIdentifier":"922ae5d0-23b2-4344-84c9-6c971f632eb1.vm-565"}] }
Post method returns
{544eebe0-4560-42ed-ae33-42d9660edcf8}
But when I try to commit this I get the following error;
https://192.168.4.20:9669/v1/vpgSettings/544eebe0-4560-42ed-ae33-42d9660edcf8/commit
{ "Message": "Limit in MB value must be assigned" }
I’ve tried setting Journal Hard Limits in MB but no matter what values I set them I still receive this message.
I have over 200 VPG’s to create which will be a real pain if I can’t get this working.
Junichi SFebruary 22, 2017 01:26:12 PMHey Andrew,
Please don’t try and create them by hand! You’ve done everything that I would’ve done in this scenario. I’d recommend trying the following:
- Set a journal history of 24 hours
- Set an RPO alert of 500 seconds
- Set a Test Interval of 262080
- The error may be erroneous so try again with the above
- If it still doesn’t work then perform the commit, generate logs covering the commit and raise a support case to investigate a potential bug
Please reply back the outcome and/or case number so we can help others who hit the same error. Thanks,
Joshua
Ted BMay 13, 2017 12:21:21 AMMonths later, so likely fixed or moved on; but in case someone else comes up upon this. I had the same exact problem. After troubleshooting a number of other issues, I got it down to this one issue and I noticed the ServiceProfileIdentifier was not being populated. I populated it manually in my script (by querying the service profiles directly and using that GUID) and it worked. In digging in a bit further I believe I found the problem; the below line in the script needs to be edited and Description should be changed to ServiceProfileName.
$ServiceProfileIdentifier = $VISiteServiceProfileCMD | Where-Object {$_.Description -eq $ServiceProfile} | Select ServiceProfileIdentifier -ExpandProperty ServiceProfileIdentifier
Hope that helps someone. 🙂
Ted
The forum ‘Scripting and APIs’ is closed to new topics and replies.