We are using, to generate/update our OpenNebula templates, the useful XML-RPC API as system interface. Everything seems to work fine, we can create/remove/update resources but it seems that one.vn.update is not working.
We can create and remove vnets but not update them using one.vn.update method from RPC endpoint. We are using 4.14.2 version and perl-Net-OpenNebula, available from CPAN [1]
For example if we try to update an available vnet pool to increase the number of IPs we use the method as is described in the documentation [2], so it looks like this in XML format to update vnet id 2 (we want to update the pool size):
<?xml version="1.0" encoding="us-ascii"?><methodCall><methodName>one.vn.update</methodName><params><param><value><string>oneadmin:PASSWORD</string></value></param><param><value><int>2</int></value></param><param><value><string>
AR = [
ip = "10.140.1.10",
size = "20",
type = "IP4"
]
BRIDGE = "bridge1"
BRIDGE_OVS = "ovsbr0"
NAME = "pool1"
NETWORK_MASK = "255.255.0.0"
VLAN = "YES"
VLAN_ID = "0"
QUATTOR = 1
</string></value></param><param><value><int>0</int></value></param></params></methodCall>
And from ONE RPC we get the vnet id in return, no error output (and it should means that everything went fine) but the vnet is not updated or modified at all. On the other hand we can update it from Sunstone without problems.
Something is missing or not documented regarding this method? we are able to update the rest of resources (images/VM templates) but not the vnets… any clue?
The vnet template used to create the VNet can include the Address Ranges, but after the vnet creation, ARs must be managed with the addar/rmar/updatear methods.
Actually the same happens with the name. You can define it in the template file, but OpenNebula processes and removes it from the template that ends inside the VNet. You need to use the rename methods afterwards, updating the template with a new NAME=XX has no effect.
I’m trying now to use one.vn.update_ar method as is described in [1], but now I get this error message from the RPC endpoint:
_rpc failed to make request faultCode -501 faultString Not enough parameters method one.vn.update_ar args [int, 1], [string, AR = [
ar_id = “0”,
ip = “10.1.1.10”,
size = “10”,
type = “IP4”
]
So I’m using 3 inputs, the session string and the object id to update an specific AR and the template string… but it seems that update_ar method requires something else. Maybe it also requires a new input to merge or replace the new info? as one.vn.update does?
IN Int Update type: 0: Replace the whole template. 1: Merge new template with the existing one.
I don’t know if this input is also required by one.vn.update_ar, if so the XML-RPC API documentation should be updated. do you know what’s the issue?
Yes is something else, the name is ok, it was a typo writing this message in the forum, I found that running our script the rpm xml template string is empty (so that’s the reason why I get the error message):