Editing a running VPG

  • I’m trying to to use the reference to changing a VPG’s name in section 7 in “Automating Zerto Virtual Replication with PowerShell & REST APIs Whitepaper”

    I can call the POST VPGSettings with the appropriate body to convert a VPG to a VPGSettings.

    However, when I commit, I get a a 400 error

    Unknown web error: 400 : Bad Request

    All I’m doing is changing the name, and it appears that my PUT to VPGSettingsBasic works –

    VERBOSE: {
    "JournalHistoryInHours": 24,
    "Name": "ChrisLewisRocks",
    "Priority": 2,
    "ProtectedSiteIdentifier": "d492497e-6793-4ec8-b44b-f60a43aef445",
    "RecoverySiteIdentifier": "258fcb39-d6a3-4547-8797-3605da6d372b",
    "RpoInSeconds": 300,
    "ServiceProfileIdentifier": "",
    "TestIntervalInMinutes": 262080,
    "UseWanCompression": true,
    "ZorgIdentifier": ""
    }
    VERBOSE: PUT https://il1zerto.nuveen.com:9669/v1/vpgSettings/e94ec8a7-6d7e-4b13-a5d0-381f02a18f23/basic with -1-byte payload
    VERBOSE: received 0-byte response of content type

    And a subsequent GET on VPGSettings//Basic returns the new Basic section with the updated Name.

    POSTING with VPGSettings//commit fails.

    VERBOSE: https://il1zerto.nuveen.com:9669/v1/vpgSettings/e94ec8a7-6d7e-4b13-a5d0-381f02a18f23/commit
    VERBOSE: POST https://il1zerto.nuveen.com:9669/v1/vpgSettings/e94ec8a7-6d7e-4b13-a5d0-381f02a18f23/commit with 0-byte payload
    Unknown web error: 400 : Bad Request
    At C:\Scripts\Zerto\ZertoModule\ZertoModule.psm1:850 char:17
    + ... throw "Unknown web error: " + $err.Exception.Response.Sta ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (Unknown web error: 400 : Bad Request:String) [], RuntimeException
    + FullyQualifiedErrorId : Unknown web error: 400 : Bad Request

    Chris@ChristopherLewis.com
    Tagged: 

    Hey Chris,

    Maybe its just a typo in pasting to the forum, but there appears to be a space in the URLs you are using: “https://il1zerto.nuveen.com :9669”. If you are just trying to change the name make sure you are just using the sample JSON and commands below:

    $JSON =
    “{
    “”Basic””: {
    “”Name””: “”$NewVPGName””
    }
    }”
    # Put URL & command
    $EditVPGURL = $BaseURL + “vpgsettings/” + $VPGSettingsIdentifier
    Try
    {
    $EditVPG = Invoke-RestMethod -Method PUT -Uri $EditVPGURL -Body $JSON -ContentType $TypeJSON -Headers $zertosessionHeader
    }
    Catch {
    Write-Host $_.Exception.ToString()
    $error[0] | Format-List -Force
    }
    # Committing the VPG setting
    $CommitVPGSettingURL = $BaseURL+”vpgSettings/”+”$VPGSettingsIdentifier”+”/commit”
    write-host “CommitVPGSettingURL:$CommitVPGSettingURL”
    Try
    {
    Invoke-RestMethod -Method Post -Uri $CommitVPGSettingURL -ContentType $TypeJSON -Headers $zertosessionHeader -TimeoutSec 100
    }
    Catch {
    Write-Host $_.Exception.ToString()
    $error[0] | Format-List -Force
    }

    If this is what you are using and still getting then try the same name change in the GUI first. It could be a duplicate name which is preventing the change. You can also go to ZVR in Program Files on the ZVM, logs, delete the latest log, re-run your commands, take a copy of the log, then look through it for “API” calls and you will get more information on why the commit is failing. Any further questions let me know. Thanks,

    Joshua

    Tagged: 

    Found the error in the logs –

    00000000,00000000,16-12-19 11:07:30.48,W,60,Utils,PreserveExceptionStackTrace,”Exception FormatException (Limit in MB value must be assigned), cannot be serialized to preserve Stack, skipping. System.FormatException: Limit in MB value must be assigned

    at Zerto.Zvm.Api.VpgSettings.Facade.Convertors.VpgSettingApiConvertionUtils.LogErrorAndThrowException(String errorTxt) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\Convertors\VpgSettingApiConvertionUtils.cs:line 53
    at Zerto.Zvm.Api.VpgSettings.Facade.Convertors.VpgSettingApiConvertionUtils.InformErrors(List`1 listOfErrors) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\Convertors\VpgSettingApiConvertionUtils.cs:line 38
    at Zerto.Zvm.Api.VpgSettings.Facade.Convertors.VpgSettingsCommitConverter.Commit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\Convertors\VpgSettingsCommitConverter.cs:line 39
    at Zerto.Zvm.Api.VpgSettings.Facade.ZvmApiVpgSettingsFacade.VpgSettingsCommit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\ZvmApiVpgSettingsFacade.cs:line 788
    at Zerto.Zvm.Api.VpgSettings.VpgSettingsService.VpgSettingsCommit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\VpgSettingsService.cs:line 229
    at Zerto.Zvm.Api.ServicesDispatcher.VpgSettingsCommit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\ServicesDispatcher.cs:line 1080
    at DynamicModule.ns.Wrapped_ServicesDispatcher_f4c79229b13d4b7da96dad09a0d281ae.<VpgSettingsCommit_DelegateImplementation>__128(IMethodInvocation inputs, GetNextInterceptionBehaviorDelegate getNext)”,
    00000000,00000000,16-12-19 11:07:30.48,W,60,Utils,PreserveExceptionStackTrace,”Exception FormatException (Limit in MB value must be assigned), cannot be serialized to preserve Stack, skipping. System.FormatException: Limit in MB value must be assigned
    at Zerto.Zvm.Api.VpgSettings.Facade.Convertors.VpgSettingApiConvertionUtils.LogErrorAndThrowException(String errorTxt) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\Convertors\VpgSettingApiConvertionUtils.cs:line 53
    at Zerto.Zvm.Api.VpgSettings.Facade.Convertors.VpgSettingApiConvertionUtils.InformErrors(List`1 listOfErrors) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\Convertors\VpgSettingApiConvertionUtils.cs:line 38
    at Zerto.Zvm.Api.VpgSettings.Facade.Convertors.VpgSettingsCommitConverter.Commit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\Convertors\VpgSettingsCommitConverter.cs:line 39
    at Zerto.Zvm.Api.VpgSettings.Facade.ZvmApiVpgSettingsFacade.VpgSettingsCommit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\Facade\ZvmApiVpgSettingsFacade.cs:line 788
    at Zerto.Zvm.Api.VpgSettings.VpgSettingsService.VpgSettingsCommit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\VpgSettings\VpgSettingsService.cs:line 229
    at Zerto.Zvm.Api.ServicesDispatcher.VpgSettingsCommit(String vpgSettingsIdentifier) in E:\athena_main\dev\system\Zvm\Zerto.Zvm.API\ServicesDispatcher.cs:line 1080
    at DynamicModule.ns.Wrapped_ServicesDispatcher_f4c79229b13d4b7da96dad09a0d281ae.<VpgSettingsCommit_DelegateImplementation>__128(IMethodInvocation inputs, GetNextInterceptionBehaviorDelegate getNext)”,
    00000000,00000000,16-12-19 11:07:30.48,I,60,LoggingOperationInvoker,Invoke,Method VpgSettingsCommit of class DynamicModule.ns.Wrapped_ServicesDispatcher_f4c79229b13d4b7da96dad09a0d281ae called took 2 msec,
    00000000,00000000,16-12-19 11:07:30.48,E,60,LoggingOperationInvoker,Invoke,”System.FormatException: Limit in MB value must be assigned
    at DynamicModule.ns.Wrapped_ServicesDispatcher_f4c79229b13d4b7da96dad09a0d281ae.VpgSettingsCommit(String vpgSettingsIdentifier)
    at SyncInvokeVpgSettingsCommit(Object , Object[] , Object[] )
    at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
    at Zerto.Infra.WCF.LoggingOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in E:\athena_main\dev\system\infra\cs\Zerto.Infra\WCF\LoggingOperationInvoker.cs:line 32″,”System.FormatException System.String VpgSettingsCommit(System.String) System.FormatException: Limit in MB value must be assigned
    at DynamicModule.ns.Wrapped_ServicesDispatcher_f4c79229b13d4b7da96dad09a0d281ae.VpgSettingsCommit(String vpgSettingsIdentifier)
    at SyncInvokeVpgSettingsCommit(Object , Object[] , Object[] )
    at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
    at Zerto.Infra.WCF.LoggingOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in E:\athena_main\dev\system\infra\cs\Zerto.Infra\WCF\LoggingOperationInvoker.cs:line 32″
    ,00000000,16-12-19 11:07:30.48,E,60,BasicRestApiErrorHandler,ProvideFault,(running number 636150955731027127) Limit in MB value must be assigned,”System.FormatException System.String VpgSettingsCommit(System.String) System.FormatException: Limit in MB value must be assigned
    at DynamicModule.ns.Wrapped_ServicesDispatcher_f4c79229b13d4b7da96dad09a0d281ae.VpgSettingsCommit(String vpgSettingsIdentifier)
    at SyncInvokeVpgSettingsCommit(Object , Object[] , Object[] )
    at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
    at Zerto.Infra.WCF.LoggingOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in E:\athena_main\dev\system\infra\cs\Zerto.Infra\WCF\LoggingOperationInvoker.cs:line 45
    at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
    at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)”

     

    Which is interesting since I’m not changing the Limit in MB – just the name.

     

    Chris@ChristopherLewis.com
    Tagged: 

The forum ‘Scripting and APIs’ is closed to new topics and replies.