Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231085

How to add parent network to existing vapp via REST api when fenceMode is isolated?

$
0
0

Hello!

We have a vApp instantiated on vcd host via vApp template, vApp network config section xml looks like:


<?xml version="1.0" encoding="UTF-8"?><NetworkConfigSection xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/" ovf:required="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://mycloud.stratogen.com/api/v1.5/schema/master.xsd">  <ovf:Info>The configuration parameters for logical networks</ovf:Info>  <Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/"/>  <NetworkConfig networkName="VM Network">  <Link rel="repair" href="https://mycloud.stratogen.com/api/admin/network/86d21d4f-0b15-44e3-877e-5b5160ea9271/action/reset"/>  <Description>The VM Network network</Description>  <Configuration>  <IpScope>  <IsInherited>false</IsInherited>  <Gateway>192.168.254.1</Gateway>  <Netmask>255.255.255.0</Netmask>  <IpRanges>  <IpRange>  <StartAddress>192.168.254.100</StartAddress>  <EndAddress>192.168.254.199</EndAddress>  </IpRange>  </IpRanges>  </IpScope>  <FenceMode>isolated</FenceMode>  <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>  </Configuration>  <IsDeployed>false</IsDeployed>  </NetworkConfig></NetworkConfigSection>

 

I have read official vmware documentation about NetworkConfigSection and tried to add ParentNetwork and switch to natRouted fence mode exactly as it was in example: https://pubs.vmware.com/vcd-51/index.jsp?topic=%2Fcom.vmware.vcloud.api.doc_51%2FGUID-92622A15-E588-4FA1-92DA-A22A4757F2A0.html

So, now my XML looks like:

<?xml version="1.0" encoding="UTF-8"?><NetworkConfigSection xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/" ovf:required="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://mycloud.stratogen.com/api/v1.5/schema/master.xsd">  <ovf:Info>The configuration parameters for logical networks</ovf:Info>  <Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://mycloud.stratogen.com/api/vApp/vapp-0991d221-1b3e-47aa-ab69-2d8f300f454d/networkConfigSection/"/>  <NetworkConfig networkName="VM Network">  <Link rel="repair" href="https://mycloud.stratogen.com/api/admin/network/86d21d4f-0b15-44e3-877e-5b5160ea9271/action/reset"/>  <Description>The VM Network network</Description>  <Configuration>  <IpScopes>  <IpScope>  <IsInherited>false</IsInherited>  <Gateway>192.168.254.1</Gateway>  <Netmask>255.255.255.0</Netmask>  <IpRanges>  <IpRange>  <StartAddress>192.168.254.100</StartAddress>  <EndAddress>192.168.254.199</EndAddress>  </IpRange>  </IpRanges>  </IpScope>  </IpScopes>  <FenceMode>natRouted</FenceMode>  <ParentNetwork  type="application/vnd.vmware.vcloud.network+xml"  name="Internet"  href="https://vcloud.example.com/api/network/54" />  <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>  </Configuration>  <IsDeployed>false</IsDeployed>  </NetworkConfig></NetworkConfigSection>

 

I submitted this XML via PUT request with content type: "application/vnd.vmware.vcloud.networkConfigSection+xml" back to where I got it, as it was described in documentation.

But I always have an error:

 

<?xml version="1.0" encoding="UTF-8"?><Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="BAD_REQUEST" message="Bad request
 - Unexpected JAXB Exception
 - cvc-complex-type.2.4.a: Invalid content was found starting with element \'ParentNetwork\'. One of \'{&quot;http://www.vmware.com/vcloud/v1.5&quot;:RetainNetInfoAcrossDeployments, &quot;http://www.vmware.com/vcloud/v1.5&quot;:Features, &quot;http://www.vmware.com/vcloud/v1.5&quot;:SyslogServerSettings, &quot;http://www.vmware.com/vcloud/v1.5&quot;:RouterInfo}\' is expected." majorErrorCode="400" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://mycloud.stratogen.com/api/v1.5/schema/master.xsd"></Error>

 

Basically, I need to switch networking fencing mode from isolated to natRouted and add parent network. Via REST API.

 

What I have:

Снимок экрана 2015-08-01 в 13.37.44.png

What I need:

Снимок экрана 2015-08-01 в 13.38.07.png

 

Where I was wrong and what should I do to add parent network and update fencing mode via REST API?

And why I always have this exception? nvalid content was found starting with element \'ParentNetwork\'.nvalid content was found starting with element \'ParentNetwork\'.nvalid content was found starting with element \'ParentNetwork\'Invalid content was found starting with element \'ParentNetwork\'.

Thanks.

 

/Dmitriy


Viewing all articles
Browse latest Browse all 231085

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>