WARNING. This script is to be used for informational and learning purposes only. Should you choose to modify and or include this script in your test or production environments, you do so at your own risk. Custom scripts are only supported by Snow, when they are produced by a Snow Application Architect as part of a paid service engagement.
phpIPAM is a free opensource IP address Management tool. phpIPAM can be integrated into Commander to get and assign IP address on deployment for VM's in an VMware environment and remove the address on decomissioning.
Requirements
- Commander scripts
- PowerShell v4 installed on the Commander application server
- Snow® Commander® 6.1.4 or later
- Snow Commander 2.8 REST API powershell libraries (Download here )
- phpIPAM Version 1.3.1 or higher can be downloaded from https://phpipam.net/
Prepare the Script Files
Download and extract the script to your Commander application server. Snow recommends storing all scripts called by Commander in a single location (c:\Scripts) for example. These scripts are executed by Commander. With the scripts extracted, the file system will look like this:
The scripts require minor editing before they will work with your systems. Refer to the comments in the individual script or the table below for guidance on editing the contents.
| Setting | Description |
| $vCommanderURL | The Web URL of the vCommander server. |
| $vCredFile | The credentials file which handles access to your vCommander. For more details, please refer to the Appendix: PowerShell Script Credential Encryption in the vCommander API Getting Started Guide, available here. |
| $phpipamurl | The vCenter Server name as it appears in vCommander. This value must be resolvable via DNS and reachable from the vCommander application server. |
| $phpipamCred | The credentials file which handles access to your phpipam Server. For more details, please refer to the Appendix: PowerShell Script Credential Encryption in the vCommander API Getting Started Guide, available here. |
| $PhpIpamAppID | The AppID from PhpIpam set to "None" for security to use password authentication |
| $Description | Description field for IPAM so administrators know which system populated the address |
Note: Your Environment may require additional or different logic depending on how phpIPAM has been configured. This example assumes the virtual Portgroup Name matches the subnet Description in phpIPAM and DNS, Gateway are configured.
The phpipam_NextIP.ps1 has sample logic to ensure that production goes to the production portgroup when deploying through Commander. You can edit this logic for any combination as long as there is a match in phpIPAM for the name of the portgroup in the description field for a subnet.
Update Approval Workflow
Now that the scripts and credentials have been configured it's time to update the approval workflow to call out to phpIPAM and Assign IP addresses for each VM in the request based on a Service Form attribute. In this example we use a "Service Type" form attribute with Static drop downs for "Production, Development,and QA"
Sample Form:
Adding a step to call the script on a new request with the following command line syntax:
powershell.exe c:\Scripts\phpipam\phpipam_nextIP.ps1 -RequestID "#{request.id}" -ServiceType "#{request.services[1].settings.customAttribute['Service Type']}"
That's all there is to assigining an ip from phpIPAM.
Update Decomissioning Workflow
Now to configure Commander to remove the assigned address when the service is decommissioned through Commander.
Edit your completion workflow that's tied to your decommissioning change request form.
Add an execute script step to remove the IP from phpIPAM before your delete vm step with the following commandline syntax:
powershell.exe c:\Scripts\phpipam\phpipam_releaseIP.ps1 -IPAddress "#{target.ipv4Addresses}"
Now Request a VM as a test if everything was configured properly you will see an entry in phpIPAM for the newly created VM and the Customized vm will have the correct network information assigned.
New address assigned in phpIPAM:
Verify the Deployed VM has the correct information:
Related Articles
IP address not reported by Columbus Inventory Agent 4Number of Views Virtual Adapter IP Address Captured When Connected to VPN 7Number of Views FNP Calling IP Address 169.254.169.254 7Number of Views IP Address Field Being Truncated 4Number of Views IP Address for email sent from the FlexNet Operations Cloud system 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago