...
In basic zone CloudStack provides AWS EIP functionality using EIP like functionality using static NAT (1:1 NAT) from public IP to VM's private IP in basic zone. Below are the semantics of EIP as implemented in CloudStack.
- When a user VM is deployed, a public ip is automatically acquired. This IP is owned by the vm's account and is marked as 'system' in the db.
- When the user VM starts, static NAT is provisioned on the static NAT provider between the public ip and the guest ip of the vm.
- The user can also acquire a public ip by calling the associateIp API. When this api call returns, there is a public ip associated with the account, but not mapped to any guest ip.
- The IP acquired in #3 can be static NAT to the VM deployed in #1 by calling enableStaticNat API. This causes the IP allocated in #1 to be returned to the public ip pool. The static NAT rules configured on the Static NAT provider are re-programmed to remove the original mapping and carry out the new mapping.
- The public IP with static NAT enabled in #4 can be removed from static NAT by calling the disableStaticNAT API. This causes the Static nat provider to remove the static nat rule. A new public IP is allocated (not necessarily the same as the one allocated in #1 and static NAT'ed with the guest IP of the VM.
- When the VM is stopped, if the ip address has isSystem=true(allocated during the vmDeploy) then public Ip is removed from the static NAT mapping and released into public pool.
...