I have 59 external networks defined in my Provider VDC and over a hundred directly connected OrgVDC networks mapping back to those.
I need to update the DNS records for the static IP pools associated with each external network and it appears to me at least that I cannot do this via the PowerCLI cmdlets for vCloud?
the Set options I have:
Am I missing something or is this going to have to be done manually through the UI?
Hi,
PowerCLI has no Set cmdlet for external network, but you can use views to update DNS and IP ranges. Here is an example of how you can do that:
# Get an external network
$myExtNetwork = Get-ExternalNetwork -Name 'PCLI-Ext-943'
# Get the external network's view
$myExtNetworkView = $myExtNetwork.ExtensionData
# Here is how to get current network configuration (DNS)
$myExtNetworkView.Configuration.IpScopes.IPScope
IsInherited : False
Gateway : 10.23.95.253
Netmask : 255.255.254.0
Dns1 : 10.23.108.1
Dns2 : 10.23.108.2
DnsSuffix : eng.vmware.com
IsEnabled : True
IpRanges : VMware.VimAutomation.Cloud.Views.IpRanges
AllocatedIpAddresses : VMware.VimAutomation.Cloud.Views.IpAddresses
SubAllocations : VMware.VimAutomation.Cloud.Views.SubAllocations
AnyAttr :
VCloudExtension :
# Here is how to get current network configuration (IPRanges). Bear in mind that here I'm accessing the 1st IPScope element, they could be more than one
$myExtNetworkView.Configuration.IpScopes.IPScope[0].IpRanges.IpRange
StartAddress EndAddress AnyAttr VCloudExtension
------------ ---------- ------- ---------------
10.23.94.1 10.23.95.249
# In order to update DNS and IPRange use the follwoing.
$myExtNetworkView.Configuration.IpScopes.IPScope[0].Dns1 = '10.23.83.229'
# Bear in mind that here I'm accessing the 1st IPRange element, they could be more than one
$myExtNetworkView.Configuration.IpScopes.IPScope[0].IpRanges.IpRange[0].StartAddress = '10.23.94.100'
$myExtNetworkView.Configuration.IpScopes.IPScope[0].IpRanges.IpRange[0].EndAddress = '10.23.94.200'
# To update the changed configuration on the server you need to call UpdateServerData
$myExtNetworkView.UpdateServerData()
I hope this will save up your time clicking in the UI.
Regards,
Dimitar Milov
Thanks Dimitar! that is exactly the kind of detail I need to help with our scripting effort.
out of curiousity, is there a reference guide or some other documentation I should be looking at to get this kind of information? we were digging around the REST API documentation yesterday and coming close to figuring it out there but couldn't actually get a PUT update to take.
Hi,
Unfortunately Views have no official public documentation. Here are the general rules for mapping REST API operations to Views methods:
GET operations are represented by proerties and UpdateViewData method could be used for refresh.
POST operations are represented by methods named as the name of the operation.
PUT operations are represented by UpdateServerData method
DELETE operations are represented by Delete method
Regards,
Dimitar Milov
I use the vCloud API schema reference. Once you find what you are looking for in the Schema reference, it's pretty easy to find in the PowerCLI objects. :smileygrin:
Cheers,
Jake