Quantcast
Channel: VMware Communities : Popular Discussions - vCloud Director PowerCLI
Viewing all articles
Browse latest Browse all 13334

Gateway address and subnet mask have to be provided...

$
0
0

I am trying to get this script working for creating an OrgNetwork in vCD 5.1.  When I run it I get an exception saying that "Gateway address and subnet mask have to be provided when creating routed/isolated org VDC network."  Here is what I have, this is a modified version of a vApp network creation script that Jake Robinson wrote:

 

$orgName = "1001"

$org = Get-OrgVdc $orgName | Get-CIView

 

$mynetwork = new-object vmware.vimautomation.cloud.views.orgvdcnetwork

$mynetwork.Name = "1001-Test"

 

$mynetwork.configuration = new-object vmware.vimautomation.cloud.views.networkconfiguration

$mynetwork.configuration.fencemode = "natRouted"

 

 

$mynetwork.Configuration.IpScope = new-object vmware.vimautomation.cloud.views.ipscope

$mynetwork.Configuration.IpScope.Gateway = "192.168.2.1"

$mynetwork.Configuration.IpScope.Netmask = "255.255.255.0"

$mynetwork.Configuration.IpScope.Dns1 = "192.168.2.1"

 

$mynetwork.Configuration.IpScope.IpRanges = new-object vmware.vimautomation.cloud.views.ipranges

$mynetwork.Configuration.IpScope.IpRanges.IpRange = new-object vmware.vimautomation.cloud.views.iprange

$mynetwork.Configuration.IpScope.IpRanges.IpRange[0].startaddress = "192.168.2.100"

$mynetwork.Configuration.IpScope.IpRanges.IpRange[0].endaddress = "192.168.2.200"

 

$result = $org.CreateNetwork($mynetwork)

 

Any help would be greatly appreciated.  Thanks in advance!


Viewing all articles
Browse latest Browse all 13334

Trending Articles



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