I am plagued with a problem. Several things keep me from being able to complete my task. One being I am not knowledgable enough with the vCloud API and PowerCli. But I have managed to do some pretty cool task. This one is much more difficult. I have searched a lot on the web and come close to getting somewhere but I am still not there.
The problems:
- Doing NAT routing on a VCD Org is time consuming and leads to mistakes from typos. It is not always repetitive but it does seem to be most of the time.
The Goals:
Automate NAT routing when a new vapp is created.
The setup:
One ORG
- One VDC
Possible Multiple vApps
- One Org VDC Network
The vApps are connected directly to the Org VDC Network and then connected to the Edge Gateway
I want to query the VMs in the vApps to get the IP address for them so I can use this to create the NAT rule on the Edge Gateway.
I want the user to enter the ORG Name to kick it off.
The Rules for the Rules:
- 1 SNAT Rule with the following:
- Applied On: External-Untrusted (Constant)
- Original (Internal) source IP/range:192.168.1.1-192.168.1.254 (Constant)
- Translated (External) source IP/range: Set equal to the External Network Address (Dynamic per org)
- Multiple DNAT rules with the following
- 1 Rule per VM
- Applied On: External-Untrusted (Constant)
- Original (External) IP/range: Set equal to the External Network Address (Dynamic per org)
- Protocol: TCP (constant)
- Original port: 30000 + the last Octet of the VMs IP address (Dynamic)
- Translated (Internal) IP/range: Set equal to the IP of the VM (Dynamic)
- Translated port: 3389 (Constant)
What I need help with the most is getting the edge IP, query of all the VMs in the org to get the IPs and making the rules as well as applying it to the edge.