I can run the following to show me all the leased IP’s for each network:
$ onevnet show
but how do I find out ALL the leased IP’s for ALL the defined networks with a single command? I could call onvnet show through a loop over all the networks but that is slow and rather ugly. Looking for a single command, if possible.
There are 9 IPs allocated, with start IP 10.2.1.40.
So you convert the first IP Address to IP Number and add the INDEX. Then convert back the result from IP Number to IP Address to have the dot notation.
For example, the last allocated IP is 167903528 + 9 = 167903537 where 167903537 is 10.2.1.49.
These values are referenced as “binary_magic” in the OpenNebula code. The upper part of this 64bit value defines the type of the allocation, currently VM, VNet or VRouter. The lower value is the OID of the entry in case of VM, it is the VM’s ID. The value of 0xFFFFFFFF defines the allocation as on HOLD.