Subject: New API call to change Primary IP address after VM creation in Advanced Zones.
Background: Currently the only way to change the IP address (via the API) is to drop a NIC attached to the VM and then add a new NIC with the desired new IP address. The process is as follows:
1. Add Temp NIC
2. Make Temp NIC default
3. Remove original NIC
4. Add NIC on same network as NIC removed in step 3, specifying IP as you add it 5. Make newly added NIC default 6. Remove Temp NIC
This process works however it will mean the VM will see a new MAC address which could mean additional configuration is required.
The existing API calls (removeIPFromNic & addIpToNic) only allow the user to modify the secondary IP addresses. This proposal is to create a new API call allowing the user to reset the IP address without the need to remove and add a new NIC.
1. Add a new API call under the NIC section for root & admin users, allowing them to specify a new IP address for a given NIC e.g. amendIpToNic ( int nicId, string oldIpAddress, string newIpAddress )
2. The system should check to ensure the new IP address that is being applied isn’t already in use on the network.
3. The API call on success will require the virtual machine to be restarted for DHCP to be refreshed.
4. The functionality should apply to Advanced Zones.
While we will perform a cursory check to see that the IP address isn’t already in use, no other checks will be made. It will still be up to the domain administrator to manage IP allocation.