Automatic OS IP assignment. What do I need to make this happen?

Hey Anton,

I’m revisiting this topic.

Given this:

[root@one01 dummy]# ls -altri
total 32
202709534 -rwxr-xr-x. 1 oneadmin oneadmin 2287 Sep 24 09:59 unregister_address_range
202709533 -rwxr-xr-x. 1 oneadmin oneadmin 4666 Sep 24 09:59 register_address_range
202709532 -rwxr-xr-x. 1 oneadmin oneadmin 4249 Sep 24 09:59 get_address
202709531 -rwxr-xr-x. 1 oneadmin oneadmin 3768 Sep 24 09:59 free_address
202709530 -rwxr-xr-x. 1 oneadmin oneadmin 3866 Sep 24 09:59 allocate_address
202709529 drwxr-x---. 2 oneadmin oneadmin 4096 Nov  3 19:37 .
134569729 drwxr-x---. 4 oneadmin oneadmin   31 Nov  3 19:37 ..
[root@one01 dummy]# pwd
/var/lib/one/remotes/ipam/dummy
[root@one01 dummy]# cd ..
[root@one01 ipam]# ls -altri
total 12
202709529 drwxr-x---.  2 oneadmin oneadmin 4096 Nov  3 19:37 dummy
134569729 drwxr-x---.  4 oneadmin oneadmin   31 Nov  3 19:37 .
   635507 drwxr-x---.  2 oneadmin oneadmin 4096 Nov  3 19:37 packet
134569666 drwxr-x---. 13 oneadmin oneadmin 4096 Nov  3 19:37 ..
[root@one01 ipam]#

and the above two pages, I’m free to write any code in any language as long as it has the following components?

allocate_address  
free_address  
get_address  
register_address_range  
unregister_address_range

In my case, my VLAN has randomly allocated addressed and I don’t know ahead of time what these could be. In that respect I can only define the top three (perhaps) to get and free single addresses. To that end, have the following questions:

  1. Will the plugin system break or have issues if I don’t define all the functions in my code?

  2. I need to return a single IP address to register a VM with and unregister the IP when VM is disposed of. There will be a VLAN (subnet) to choose from that I could pass but it will represent randomly allocated IP’s. How will this look like if I want to reserve a single IP and free a single IP.

  3. Does the plugin system support calling subscripts as root to automatically register the environment with said IP to the DNS?

Thx,
TK

Hello @TomK

1 - You have to define all the functions, but if one of them has to be empty, just put exit 0.
2 - With allocate script you can just allocate one IP, see comments in this file. Just use size 1 and it will allocate just one IP.
3 - Yes, you can call all the scripts you want, but remember that the main script has to return the needed information by OpenNebula, you can find this information here.

1 - Ok

2 - So I’m thinking something like this then for say the get_address script as an example. Assuming a range of 10.0.0.1/24 is available but half of the IP’s are used randomly within this subnet. So my script should accept an XML message like this then it determines a free IP available on this subnet:

<IPAM_DRIVER_ACTION_DATA>
<AR>
  <TYPE>IP4</TYPE>
  <IP>10.0.0.117</IP>
  <MAC>AA:BB:CC:DD:EE:FF:00:01</MAC
  <SIZE>1</SIZE>
  <NETWORK_ADDRESS>10.0.0.117</NETWORK_ADDRESS>
  <NETWORK_MASK>255.255.255.0</NETWORK_MASK>
  <GATEWAY>10.0.0.1</GATEWAY>
  <DNS>192.168.0.1 192.168.0.2 192.168.0.3</DNS>
  <GUEST_MTU>1500</GUEST_MTU>
  <SEARCH_DOMAIN>dom.com sub.dom.com new.dom.com</SEARCH_DOMAIN>
</AR>
</IPAM_DRIVER_ACTION_DATA>

The script should then return:

ADDRESS = [ IP = "10.0.0.117", SIZE=1 ]

to STDOUT. And also return -1 if it fails to allocate, otherwise it must exit 0.

3 - Great!

Cheers,
TK

Hi

A few more questions if I may please.

  1. Are the above assumptions I posted correct?

Additional questions:

  1. Which IPAM module does OpenNebula use right now? The list on my install has the following: dummy, packet. Does it use the packet IPAM module to allocate right now or an internal system not exposed via IPAM?

  2. Looking at the existing ipam module packet code for register_address_range, there is code that instantiates objects from OpenNebula, decrypts a few elements from the first parameter passed ARGV[0], which is the XML input message, from Base64 using nokogiri, retrieves ONE_KEY from the object. It then get’s a PACKET_TOKEN from the passed ARGV[0] parameter, which is not mentioned on the docs page. Should I care about all this or just focus on what the docs page has? The reason is I need to do this in bash and in case I need higher-level functions to interact with OpenNebula objects or perform API calls, I may need to go the python route. Are there examples of ipam modules in bash or python I can use as examples and extend for my purpose?

Thx,
TK

Hello @TomK

  1. Are the above assumptions I posted correct?

Yes, they are correct.

4- Yes, currently only dummy and Packet are available. The Packet IPAM is used in VMs deployed on baremetal Packet host so they get public connectivity.

5 - In the new version (5.10) you don’t need to decrypt anything, it’s done in the core using the ENCRYPTED_ATTR. PACKET_TOKEN is needed by Packet, so you don’t need this token. We don’t have examples in Python, but of course you can use it, the only thing is to respect the inputs and outputs.

Álex.

Thank you very much. Let me give these a try this weekend.

Hey All, Can the code be ran as root or will it be ran as the oneadmin user?

I’m trying to pass additional parameters to the scripts to limit the IP’s returned to a specific range. For example, I want the IP’s returned to be within the range of 10.0.0.50 - 10.0.0.254 .

  1. Is it possible to do this by adding additional elements to the XML
  2. Thinking using GetOpts on paramters such as --limit or -l isn’t possible right now?

Thx,
TK

Can the code be ran as root or will it be ran as the oneadmin user?

The code is ran as oneadmin user, but you can use sudo inside of it if you need it.

  1. Is it possible to do this by adding additional elements to the XML

The script is going to receive the address range information, so if you add an extra field, you will have it.

  1. Thinking using GetOpts on paramters such as --limit or -l isn’t possible right now?

It’s not possible.

Hi,

Writing and testing the Python class that now dynamically returns the block below, based on what IP ranges are free. However, I have a few questions that just came up.

If I have the following return block for register_address_range (or get_address):

        AR = [
            IPAM_MAD = "ipmapper",
            TYPE = "IP4",
            IP   = "10.0.0.100",
            SIZE = "155",
            NETWORK_ADDRESS   = "10.0.0.0",
            NETWORK_MASK      = "255.255.255.0",
            GATEWAY           = "10.0.0.1",
            DNS               = "192.168.0.10 192.168.0.11 192.168.0.12 192.168.0.13 192.168.0.14 192.168.0.15 192.168.0.16",
            IPAM_ATTR         = "10.0.0.255",
            OTHER_IPAM_ATTR   = "my.dom.abc"
        ]
  1. What is IPAM_ATTR?

  2. Do I need a ‘.’ before the OTHER_IPAM_ATTR string?

  3. What are the functional differences between allocate_address and get_address? allocate_address appears like a check?

  4. When using unregister_address_range, can you elaborate with more details on what exactly happens within ON when this is called? In other words, could you please share more exact details what happens at each step of the way when this function is called?

Cheers,
TK

If I’m unregistering an address range, is there some OpenNebula API’s I need to call that will tell me if any VM is using an IP in the range I’m unregistering?

Just want to confirm since the page here did not have this information:

http://docs.opennebula.org/5.10/integration/infrastructure_integration/devel-ipam.html

Cheers,
TK

FYI.

Using and testing the new IPAM drivers. In the process of instantiating a VM from a template that uses the new IPAM driver, I run into a crash:

Tue Mar 10 01:54:47 2020 [Z0][AuM][D]: Message received: AUTHENTICATE SUCCESS 1 -

Tue Mar 10 01:54:47 2020 [Z0][ReM][D]: Req:6592 UID:0 IP:127.0.0.1 one.template.info invoked , 2, false
Tue Mar 10 01:54:47 2020 [Z0][ReM][D]: Req:6592 UID:0 one.template.info result SUCCESS, "<VMTEMPLATE><ID>2</I..."
Tue Mar 10 01:54:47 2020 [Z0][ReM][D]: Req:6080 UID:0 IP:127.0.0.1 one.template.instantiate invoked , 2, "getautonet01.nix.mds...", false, "DISK=[
  FORMAT="raw...", false
Tue Mar 10 01:54:49 2020 [Z0][IPM][D]: Message received: GET_ADDRESS SUCCESS 2 QVIgPSBbIAogICAgSVAgPSAiMTAuMC4wLjE1MiIsIAogICAgU0laRSA9ICIxIiAKXQo=


==> sunstone.log <==
Tue Mar 10 01:54:49 2020 [I]: 192.168.0.76 - - [10/Mar/2020:01:54:49 -0400] "POST /vmtemplate/2/action HTTP/1.1" 500 - 3.2293
tail: oned.log: file truncated
Tue Mar 10 01:54:55 2020 [Z0][ONE][I]: Starting OpenNebula 5.8.5
----------------------------------------
     OpenNebula Configuration File
----------------------------------------
API_LIST_ORDER=DESC
AUTH_MAD=AUTHN=ssh,x509,ldap,server_cipher,server_x509,EXECUTABLE=one_auth_mad
AUTH_MAD_CONF=DRIVER_MANAGED_GROUPS=NO,MAX_TOKEN_TIME=-1,NAME=core,PASSWORD_CHANGE=YES
AUTH_MAD_CONF=DRIVER_MANAGED_GROUPS=NO,MAX_TOKEN_TIME=-1,NAME=public,PASSWORD_CHANGE=NO
AUTH_MAD_CONF=DRIVER_MANAGED_GROUPS=NO,MAX_TOKEN_TIME=-1,NAME=ssh,PASSWORD_CHANGE=YES
AUTH_MAD_CONF=DRIVER_MANAGED_GROUPS=NO,MAX_TOKEN_TIME=-1,NAME=x509,PASSWORD_CHANGE=NO
AUTH_MAD_CONF=DRIVER_MANAGED_GROUPS=YES,MAX_TOKEN_TIME=86400,NAME=ldap,PASSWORD_CHANGE=YES
AUTH_MAD_CONF=DRIVER_MANAGED_GROUPS=NO,MAX_TOKEN_TIME=-1,NAME=server_cipher,PASSWORD_CHANGE=NO
AUTH_MAD_CONF=DRIVER_MANAGED_GROUPS=NO,MAX_TOKEN_TIME=-1,NAME=server_x509,PASSWORD_CHANGE=NO
DATASTORE_CAPACITY_CHECK=yes
DATASTORE_LOCATION=/var/lib/one//datastores
DATASTORE_MAD=ARGUMENTS=-t 15 -d dummy,fs,lvm,ceph,dev,iscsi_libvirt,vcenter -s shared,ssh,ceph,fs_lvm,qcow2,vcenter,EXECUTABLE=one_datastore
DB=BACKEND=mysql,CONNECTIONS=50,DB_NAME=opennebula,PASSWD=cman90-,PORT=0,SERVER=mysql-c01.nix.mds.xyz,USER=oneadmin
DEFAULT_AUTH=default
DEFAULT_CDROM_DEVICE_PREFIX=hd
DEFAULT_COST=CPU_COST=0,DISK_COST=0,MEMORY_COST=0
DEFAULT_DEVICE_PREFIX=hd
DEFAULT_IMAGE_PERSISTENT=
DEFAULT_IMAGE_PERSISTENT_NEW=
DEFAULT_IMAGE_TYPE=OS
DEFAULT_UMASK=177

[root@one01 log]# grep -Ei oned messages
Mar 8 18:55:19 one01 kernel: oned[14897]: segfault at 20 ip 000000000041f4b0 sp 00007ff6d1ff8450 error 4 in oned[400000+346000]
Mar 8 19:00:10 one01 kernel: oned[16189]: segfault at 20 ip 000000000041f4b0 sp 00007fb4d2ffa450 error 4 in oned[400000+346000]
Mar 8 19:09:45 one01 kernel: oned[18863]: segfault at 20 ip 000000000041f4b0 sp 00007f02acff6450 error 4 in oned[400000+346000]
Mar 10 01:33:44 one01 kernel: oned[10548]: segfault at 20 ip 000000000041f4b0 sp 00007f5adaffa450 error 4 in oned[400000+346000]
Mar 10 01:34:13 one01 kernel: oned[11208]: segfault at 20 ip 000000000041f4b0 sp 00007f0716ffa450 error 4 in oned[400000+346000]
Mar 10 01:54:15 one01 kernel: oned[12870]: segfault at 20 ip 000000000041f4b0 sp 00007f03417f7450 error 4 in oned[400000+346000]
Mar 10 01:54:49 one01 kernel: oned[13475]: segfault at 20 ip 000000000041f4b0 sp 00007f3708ff6450 error 4 in oned[400000+346000]
[root@one01 log]#

The UI error displayed is:

end of file reached

This was due to the wrong tag for the return address:

AR = [ 
    IP = "10.0.0.152", 
    SIZE = "1" 
]

Fixed by correcting as follows:

ADDRESS = [ IP = "10.0.0.152", SIZE = "1" ]

( In case it helps someone writing similar drivers. )

Cheers,

1 Like

Hello @TomK

First of all, thanks for sharing the last tip you used!

If I’m unregistering an address range, is there some OpenNebula API’s I need to call that will tell me if any VM is using an IP in the range I’m unregistering?

Related with this, when you try to unregister an address range, OpenNebula will first check if the address range has no leases in use. So if it has any lease it won’t call the IPAM script. Then there is no need to check that in your script.

Best,
Álex.

Ty for the above note.

While doing further testing of the IPAM driver, I notice that a default MAC is used regardless of what I specify on the Virtual Network definition page.

After some investigation, I noticed that the register-address-range return AR does not include a MAC as per the following page:

http://docs.opennebula.org/5.8/integration/infrastructure_integration/devel-ipam.html#register-address-range

But in fact, the AR should return a MAC otherwise a default MAC will be populated by OpenNebula.

Thx,

IPAM Driver GetAutoNet completed. Basic testing with OpenNebula 5.8.3 completed:

GitHub Project Page

RHEL 7 / CentOS 7 RPM:
https://github.com/tomkcpr/GetAutoNet/blob/master/rpmbuild/RPMS/noarch/GetAutoNet-16.03.2020-1.2.noarch.rpm

Features

Checks IP’s and IP ranges using nmap for availability.
Checks IP and IP range availability against DNS servers.
Returns only available IP’s and IP ranges.
Supports .xml files, base64 encoded strings and plain .xml arguments (last item remains to be tested)

Notes

Please read the notes on the project page including the support page at the end of the README.md file.

Code is written in Python 3.X . Please use the provided RPM file for RHEL 7 / CentOS 7 or roll one yourself from the provided SPECS file.

Not yet tested on OpenNebula 5.10.X . Haven’t upgraded my setup yet. Should work.

Interested in feedback. In case of issues, please let me know.

Cheers,
TK

1 Like

Great work @TomK!!! Thanks for sharing this with the community.

Best,
Álex.

@ahuertas, @atodorov_storpool,

I’m adapting the driver to OpenNebula 5.10.1. When I try to use it as-is, I see that ON 5.10.1 just passes a 5 to the IPAM driver. From our earlier conversations, I’m getting the impression that I won’t need to decrypt anything. However appears ON 5.10.1 introduced additional changes since only a ‘5’ is passed to the get_address function:

==> /var/log/one/oned.log <==
Sat May 30 23:04:05 2020 [Z0][AuM][D]: Message received: AUTHENTICATE SUCCESS 4 -

Sat May 30 23:04:05 2020 [Z0][ReM][D]: Req:5008 UID:0 IP:127.0.0.1 one.template.info invoked , 3, false, false
Sat May 30 23:04:05 2020 [Z0][ReM][D]: Req:5008 UID:0 one.template.info result SUCCESS, "<VMTEMPLATE><ID>3</I..."
Sat May 30 23:04:05 2020 [Z0][ReM][D]: Req:2976 UID:0 IP:127.0.0.1 one.template.instantiate invoked , 3, "getautonet05.nix.mds...", false, "DISK=[
  FORMAT="raw...", false
Sat May 30 23:04:05 2020 [Z0][IPM][D]: Message received: LOG I 5 Command execution failed (exit code: 1): /var/lib/one/remotes/ipam/GetAutoNet/get_address 5

Sat May 30 23:04:05 2020 [Z0][IPM][I]: Command execution failed (exit code: 1): /var/lib/one/remotes/ipam/GetAutoNet/get_address 5
Sat May 30 23:04:05 2020 [Z0][IPM][D]: Message received: GET_ADDRESS FAILURE 5 LQ==

Sat May 30 23:04:05 2020 [Z0][IPM][E]: LQ==
Sat May 30 23:04:05 2020 [Z0][ONE][E]: Cannot get IP/MAC lease from virtual network 26.
Sat May 30 23:04:05 2020 [Z0][ReM][E]: Req:2976 UID:0 one.template.instantiate result FAILURE [one.template.instantiate] Error allocating a new virtual machine template. Cannot get IP/MAC lease from virtual network 26.

==> /var/log/one/sunstone.log <==
Sat May 30 23:04:05 2020 [I]: 192.168.0.76 - - [30/May/2020:23:04:05 -0400] "POST /vmtemplate/3/action HTTP/1.1" 500 - 0.8558

==> /var/log/one/oned.log <==
Sat May 30 23:04:16 2020 [Z0][InM][D]: Host mdskvm-p05.nix.mds.xyz (4) successfully monitored.
Sat May 30 23:04:16 2020 [Z0][VMM][D]: VM 45 successfully monitored: STATE=a CPU=1.0 MEMORY=647720 NETRX=259533 NETTX=20915 DISKRDBYTES=218926668 DISKWRBYTES=8906240 DISKRDIOPS=64152 DISKWRIOPS=222
Sat May 30 23:04:17 2020 [Z0][VMM][D]: VM 50 successfully monitored: STATE=a CPU=0.0 MEMORY=668876 NETRX=256587 NETTX=19649 DISKRDBYTES=215367244 DISKWRBYTES=8658944 DISKRDIOPS=63988 DISKWRIOPS=200
Sat May 30 23:04:23 2020 [Z0][ReM][D]: Req:16 UID:0 IP:127.0.0.1 one.zone.raftstatus invoked
Sat May 30 23:04:23 2020 [Z0][ReM][D]: Req:16 UID:0 one.zone.raftstatus result SUCCESS, "<RAFT><SERVER_ID>-1<..."
Sat May 30 23:04:23 2020 [Z0][ReM][D]: Req:6768 UID:0 IP:127.0.0.1 one.vmpool.infoextended invoked , -2, -1, -1, -1
Sat May 30 23:04:23 2020 [Z0][ReM][D]: Req:6768 UID:0 one.vmpool.infoextended result SUCCESS, "<VM_POOL><VM><ID>50<..."
Sat May 30 23:04:23 2020 [Z0][ReM][D]: Req:4832 UID:0 IP:127.0.0.1 one.vmpool.infoextended invoked , -2, -1, -1, -1
Sat May 30 23:04:23 2020 [Z0][ReM][D]: Req:4832 UID:0 one.vmpool.infoextended result SUCCESS, "<VM_POOL><VM><ID>50<..."
^C
[root@one01 ipam]#
[root@one01 ipam]#
[root@one01 ipam]# /var/lib/one/remotes/ipam/GetAutoNet/get_address 5
[root@one01 ipam]# echo $?
1
[root@one01 ipam]# ls -altri /var/lib/one/remotes/ipam/GetAutoNet/
total 56
135154756 -rw-r-----. 1 oneadmin oneadmin   546 Mar 15 14:22 register-address-range.xml
135154749 -rw-r-----. 1 oneadmin oneadmin   644 Mar 16 01:09 allocate-address-range.xml
135154755 -rw-r-----. 1 oneadmin oneadmin   546 Mar 16 01:55 get-single-address.xml
135154753 -rw-r-----. 1 oneadmin oneadmin   644 Mar 16 01:57 free-address-range.xml
135154754 -rw-r-----. 1 oneadmin oneadmin   585 Mar 16 02:01 get-address-range.xml
135154748 -rwxr-x---. 1 oneadmin oneadmin 32282 Mar 28 18:39 GetAutoNet.py
135154757 lrwxrwxrwx. 1 oneadmin oneadmin    13 May 30 23:02 get_single -> GetAutoNet.py
135154758 lrwxrwxrwx. 1 oneadmin oneadmin    13 May 30 23:02 free_address -> GetAutoNet.py
135154759 lrwxrwxrwx. 1 oneadmin oneadmin    13 May 30 23:02 get_address -> GetAutoNet.py
135154760 lrwxrwxrwx. 1 oneadmin oneadmin    13 May 30 23:02 allocate_address -> GetAutoNet.py
135154761 lrwxrwxrwx. 1 oneadmin oneadmin    13 May 30 23:02 unregister_address_range -> GetAutoNet.py
135154762 lrwxrwxrwx. 1 oneadmin oneadmin    13 May 30 23:02 register_address_range -> GetAutoNet.py
135154747 drwxr-x---. 2 oneadmin oneadmin  4096 May 30 23:02 .
134569729 drwxr-x---. 6 oneadmin oneadmin    69 May 30 23:02 ..
[root@one01 ipam]# tail -f /var/log/GetAutoNet/GetAutoNet.log
isBase64(self,sb):
ERROR: sys.argv[1] is neither a file, base64 encoded string nor a plain readable file.  Exiting.

getAddress(self):
isBase64(self,sb):
self.isBase64(): False
isBase64(self,sb):
isBase64(self,sb):
ERROR: sys.argv[1] is neither a file, base64 encoded string nor a plain readable file.  Exiting.

Could you please shed more light on what should I expect as input to the IPAM driver from ON 5.10.1 ?

Cheers,
TK

Hello @TomK

First of all, sorry for the delay in my answer.

As we were talking, there was a change in the encryption process, but the IPAM driver gets the data unencrypted, so you don’t have to make any decryption operation. For example, if we check src/ipamm_mad/remotes/packet/get_address:

data = Nokogiri::XML(Base64.decode64(STDIN.read))

It just reads the STDIN and parses it to XML.

Could you please paste here the VM template (onetemplate show TEMPLATE_ID -x) you are trying to instantiate? I would like to check that everything is correct.

Best,
Álex.

Hey Alex,

No worries. Got tied up with a few other things myself as well.

Yep. I recalled our discussion above. So what I was thinking would happen is that instead of passing a base64 string:

[oneadmin@one01 GetAutoNet]$ ./get_single  PElQQU1fRFJJVkVSX0FDVElPTl9EQVRBPgo8QVI+CiAgPFRZUEU+SVA0PC9UWVBFPgogIDxJUD4xMC4wLjAuMTwvSVA+CiAgPE1BQz5BQTpCQjpDQzpERDowMDowMTwvTUFDPgogIDxTSVpFPjI1NTwvU0laRT4KICA8TkVUV09SS19BRERSRVNTPjEwLjAuMC4xMTc8L05FVFdPUktfQUREUkVTUz4KICA8TkVUV09SS19NQVNLPjI1NS4yNTUuMjU1LjA8L05FVFdPUktfTUFTSz4KICA8R0FURVdBWT4xMC4wLjAuMTwvR0FURVdBWT4KICA8RE5TPjE5Mi4xNjguMC40NCAxOTIuMTY4LjAuNDUgMTkyLjE2OC4wLjE1NCAxOTIuMTY4LjAuMTU1IDE5Mi4xNjguMC4yMjQgMTkyLjE2OC4wLjIyMCAxOTIuMTY4LjAuMjIxPC9ETlM+CiAgPEdVRVNUX01UVT4xNTAwPC9HVUVTVF9NVFU+CiAgPFNFQVJDSF9ET01BSU4+bXdzLm1kcy54eXogbml4Lm1kcy54eXogbWRzLnh5ejwvU0VBUkNIX0RPTUFJTj4KICA8TE9XRVJfTElNSVQ+MTAwPC9MT1dFUl9MSU1JVD4KICA8VVBQRVJfTElNSVQ+MjU1PC9VUFBFUl9MSU1JVD4KPC9BUj4KPC9JUEFNX0RSSVZFUl9BQ1RJT05fREFUQT4K

            AR = [
                IP  = "10.0.0.100",
                SIZE = "1"
            ]

[oneadmin@one01 GetAutoNet]$

The 5.10.1 ON would instead require just the non-base64 text as input or similar, such as this:

[oneadmin@one01 GetAutoNet]$ ./get_single  "<IPAM_DRIVER_ACTION_DATA>
<AR>
  <TYPE>IP4</TYPE>
  <IP>10.0.0.1</IP>
  <MAC>AA:BB:CC:DD:00:01</MAC>
  <SIZE>255</SIZE>
  <NETWORK_ADDRESS>10.0.0.117</NETWORK_ADDRESS>
  <NETWORK_MASK>255.255.255.0</NETWORK_MASK>
  <GATEWAY>10.0.0.1</GATEWAY>
  <DNS>192.168.0.44 192.168.0.45 192.168.0.154 192.168.0.155 192.168.0.224 192.168.0.220 192.168.0.221</DNS>
  <GUEST_MTU>1500</GUEST_MTU>
  <SEARCH_DOMAIN>mws.mds.xyz nix.mds.xyz mds.xyz</SEARCH_DOMAIN>
  <LOWER_LIMIT>100</LOWER_LIMIT>
  <UPPER_LIMIT>255</UPPER_LIMIT>
</AR>
</IPAM_DRIVER_ACTION_DATA>"

                AR = [
                    IP  = "10.0.0.100",
                    SIZE = "1"
                ]

[oneadmin@one01 GetAutoNet]$

But instead I saw that just a number ‘5’ is entered as the parameter. So wasn’t sure what to think of it:

Sat May 30 23:04:05 2020 [Z0][IPM][D]: Message received: LOG I 5 Command execution failed (exit code: 1): **/var/lib/one/remotes/ipam/GetAutoNet/get_address 5**

Including output of the onetemplate command below:

[oneadmin@one01 ~]$ onetemplate show 3 -x
<VMTEMPLATE>
  <ID>3</ID>
  <UID>0</UID>
  <GID>0</GID>
  <UNAME>oneadmin</UNAME>
  <GNAME>oneadmin</GNAME>
  <NAME>CentOS 7 - Template - Kickstart - Context - GV 0</NAME>
  <PERMISSIONS>
    <OWNER_U>1</OWNER_U>
    <OWNER_M>1</OWNER_M>
    <OWNER_A>0</OWNER_A>
    <GROUP_U>0</GROUP_U>
    <GROUP_M>0</GROUP_M>
    <GROUP_A>0</GROUP_A>
    <OTHER_U>0</OTHER_U>
    <OTHER_M>0</OTHER_M>
    <OTHER_A>0</OTHER_A>
  </PERMISSIONS>
  <REGTIME>1584507109</REGTIME>
  <TEMPLATE>
    <CONTEXT>
      <NETWORK><![CDATA[YES]]></NETWORK>
      <REPORT_READY><![CDATA[YES]]></REPORT_READY>
      <SSH_PUBLIC_KEY><![CDATA[ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8QYRv9NV9Kdw7KINeeGTHywr4AhOwy69szGKDrsHtcIqTqfJkWU0ysUFTv9SldFCroebyYSz1wgzAxEsQMQSyLhuP4PPvUXa6rHRH7F/YuTsTWZZH6xaQi98Hucsl5sGm5dJ/+mej7yiHDIFhSmN9N1rEYxH8nyWsZjdzz6coqUm/aYqTjfxk7o4ekwAnRSb5oiS7qgvieXFPr7vgELFIUjkw2DR1Wl1zLwnKD6NK5BGa/BBCRcBMkXvQmjVy6ILtxdS/PFvkMMF/Zus5wkHy2F/vLGcpYN2IkPzv8C8ihL6mqFAaydSeK7T2J81crQP7VDKbzHnSPistk8bMFCap root@awx01.nix.mds.xyz]]></SSH_PUBLIC_KEY>
      <START_SCRIPT_BASE64><![CDATA[IyEvYmluL2Jhc2gKCiMgQ2hlY2sgaWYgbmV0d29yayBpcyByZWFjaGFibGUuIElmIG5vdCwgdHJ5IHRvIGdldCBvbiB0aGUgbmV0d29yay4KcGluZyBnb29nbGUuY29tIC1jNHxncmVwICIxMDAlIHBhY2tldCBsb3NzIiA+IC9kZXYvbnVsbDsKUkVUVlY9JD8KW1sgJFJFVFZWID09IDAgXV0gJiYgewogICAgICAgIGVjaG8gIkNhbid0IHJlYWNoIGdvb2dsZS5jb20uICBSdW5uaW5nIGRoY2xpZW50IC4uLiI7CiAgICAgICAgZGhjbGllbnQKfQoKeXVtIGluc3RhbGwgd2dldCAteQp5dW0gaW5zdGFsbCBodHRwczovL2dpdGh1Yi5jb20vT3Blbk5lYnVsYS9hZGRvbi1jb250ZXh0LWxpbnV4L3JlbGVhc2VzL2Rvd25sb2FkL3Y1LjguMC9vbmUtY29udGV4dC01LjguMC0xLmVsNy5ub2FyY2gucnBtIC15CgojIEVuYWJsZSB0aGUgc2VydmljZSwgaWYgbm90IGFscmVhZHkuICBEb2Vzbid0IGh1cnQgdG8gbWFrZSBzdXJlLgpzeXN0ZW1jdGwgZW5hYmxlIG9uZS1jb250ZXh0CgojIFRoaXMgaXMgc3VwcG9zZWQgdG8gaGFwcGVuIG9uY2UgYWZ0ZXIgcHJvdmlzaW9uaW5nLgpvbmVnYXRlIHZtIHNob3cKUkVUVj0kPwoKCiMgVHJ5IG51bWVyb3VzIHRpbWVzIHRvIHJlYWNoIGEgcmVtb3RlIHNpdGUuICBJZiBzdGlsbCBmYWlsZWQsIHRoZW4gcmVzdGFydC4KZm9yIFZBTCBpbiB7MS4uNn07IGRvCiAgICAgICAgZWNobyAiVHJ5aW5nIHRvIHBpbmcgZ29vZ2xlLmNvbSAkVkFMIC4uLiI7CiAgICAgICAgcGluZyAxOTIuMTY4LjAuMSAtYzR8Z3JlcCAiMCUgcGFja2V0IGxvc3MiID4gL2Rldi9udWxsOwogICAgICAgIFJFVFZWPSQ/CiAgICAgICAgc2xlZXAgMTA7CiAgICAgICAgW1sgJFJFVFZWID09IDAgXV0gJiYgewogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfQpkb25lCgpbWyAkUkVUViAhPSAwICYmICRSRVRWViAhPSAwICYmICQocnBtIC1hcXxncmVwIC1FaSBvbmUtY29udGV4dCkgIT0gIiIgXV0gJiYgewogICAgICAgIGVjaG8gIlJlc3RhcnRpbmcgYWZ0ZXIgaW5zdGFsbGluZyBvbmUtY29udGV4dC4gIFRoaXMgd2lsbCBzZXQgdGhlIElQIG9uIHRoaXMgVk0gdGhhdCdzIGJlZW4gYWxsb2NhdGVkIGluIHRoZSBVSS4iIHwgdGVlIC1hIC92YXIvbG9nL21lc3NhZ2VzOwogICAgICAgIGVjaG8gIlJFQk9PVCEiIHwgdGVlIC1hIC92YXIvbG9nL21lc3NhZ2VzOwogICAgICAgIHJlYm9vdDsKfQoK]]></START_SCRIPT_BASE64>
      <TOKEN><![CDATA[YES]]></TOKEN>
    </CONTEXT>
    <CPU><![CDATA[2]]></CPU>
    <DESCRIPTION><![CDATA[rhel7-template]]></DESCRIPTION>
    <DISK>
      <FORMAT><![CDATA[raw]]></FORMAT>
      <SIZE><![CDATA[65536]]></SIZE>
      <TYPE><![CDATA[fs]]></TYPE>
    </DISK>
    <DISK>
      <IMAGE><![CDATA[CentOS-7-x86_64-Minimal-1908-Kickstart-Context - GV - IMG 0 - V 28]]></IMAGE>
      <IMAGE_UNAME><![CDATA[oneadmin]]></IMAGE_UNAME>
    </DISK>
    <GRAPHICS>
      <LISTEN><![CDATA[0.0.0.0]]></LISTEN>
      <TYPE><![CDATA[VNC]]></TYPE>
    </GRAPHICS>
    <HYPERVISOR><![CDATA[kvm]]></HYPERVISOR>
    <INPUTS_ORDER><![CDATA[]]></INPUTS_ORDER>
    <LOGO><![CDATA[images/logos/centos.png]]></LOGO>
    <MEMORY><![CDATA[4096]]></MEMORY>
    <MEMORY_COST><![CDATA[5]]></MEMORY_COST>
    <MEMORY_UNIT_COST><![CDATA[MB]]></MEMORY_UNIT_COST>
    <NIC>
      <NETWORK><![CDATA[IPAM - onevnet02 - VLAN 2 - 10.0.0.X]]></NETWORK>
      <NETWORK_UNAME><![CDATA[oneadmin]]></NETWORK_UNAME>
      <SECURITY_GROUPS><![CDATA[0]]></SECURITY_GROUPS>
    </NIC>
    <OS>
      <ARCH><![CDATA[x86_64]]></ARCH>
      <BOOT><![CDATA[disk0,nic0,disk1]]></BOOT>
    </OS>
    <SCHED_DS_REQUIREMENTS><![CDATA[ID="129"]]></SCHED_DS_REQUIREMENTS>
    <SCHED_REQUIREMENTS><![CDATA[ID="5" | CLUSTER_ID="100"]]></SCHED_REQUIREMENTS>
    <VCPU><![CDATA[2]]></VCPU>
  </TEMPLATE>
</VMTEMPLATE>
[oneadmin@one01 ~]$

Cheers,
TK

Hello @TomK

I need the output of onevnet show "IPAM - onevnet02 - VLAN 2 - 10.0.0.X" -x so I can check all the parameters in the virtual network.

Best,
Álex.