VNET template and cluster IDs

Hi all,

does anybody here use virtual network templates? I want to allow ordinary users to create their own VNets, so I created a VNet template and want to instantiate it under an ordinary user. The problem is that the resulting VNET gets assigned to the CLUSTER=0 regardless of what I set up in the template:


# onevntemplate show 0
TEMPLATE 0 INFORMATION                                                          
ID             : 0                   
NAME           : My VNET template        
USER           : oneadmin            
GROUP          : privgroup               
LOCK           : None                
REGISTER TIME  : 02/22 14:12:20      

PERMISSIONS                                                                     
OWNER          : um-                 
GROUP          : u--                 
OTHER          : ---                 

TEMPLATE CONTENTS                                                               
AUTOMATIC_VLAN_ID="YES"
CLUSTER="101"
FILTER_MAC_SPOOFING="YES"
GUEST_MTU="1200"
INBOUND_AVG_BW="100"
OUTBOUND_AVG_BW="100"
PHYDEV="eth0"
VN_MAD="vxlan"

See the CLUSTER=101 above. This is the cluster I want the instantiated vnets to be in.However, when I try to instantiate the VNET template 0:

# onevntemplate instantiate --name 'test-vxlan' 0
VN ID: 36
# onevnet show 36
VIRTUAL NETWORK 36 INFORMATION                                                  
ID                       : 36                  
NAME                     : test-vxlan          
USER                     : oneadmin            
GROUP                    : oneadmin            
LOCK                     : None                
CLUSTERS                 : 0                   
BRIDGE                   : onebr36             
VN_MAD                   : vxlan               
PHYSICAL DEVICE          : eth0                
VLAN ID                  : 38                  
AUTOMATIC VLAN ID        : YES                 
AUTOMATIC OUTER VLAN ID  : NO                  
USED LEASES              : 0                   

PERMISSIONS                                                                     
OWNER                    : um-                 
GROUP                    : ---                 
OTHER                    : ---                 

VIRTUAL NETWORK TEMPLATE                                                        
BRIDGE="onebr36"
BRIDGE_TYPE="linux"
CLUSTER="101"
FILTER_MAC_SPOOFING="YES"
GUEST_MTU="1200"
INBOUND_AVG_BW="100"
OUTBOUND_AVG_BW="100"
PHYDEV="eth0"
SECURITY_GROUPS="0"
TEMPLATE_ID="0"
VN_MAD="vxlan"

ADDRESS RANGE POOL                                                              

LEASES                                                                          
AR  OWNER                         MAC              IP                        IP6

VIRTUAL ROUTERS
#

The newly created VNET is added to CLUSTER=0 (only), and as such it cannot be used for new VMs in CLUSTER=101. Note that I am doing this under oneadmin, but instantiating the VNet template under an ordinary user (member of group privgroup, of course) yields the same result.

EDIT: also, when I open the VNet template in Sunstone (as oneadmin), and click on the “Clusters” tab, there is no cluster selected. Even when I click on “Select cluster”, select cluster 101, and click on “Apply changes”, there is still no cluster selected in the “Clusters” tab".

EDIT2: when I manually add parameter CLUSTERS = "101" to the template (note the plural), save the template, and then click on the “Clusters” tab, the cluster 101 is displayed as selected for this template. However, instantiating this template still results in the new VNet assigned to cluster 0.


Versions of the related components and OS (frontend, hypervisors, VMs):
CentOS Linux 7, Qemu, ONe 5.12.0.1 CE
EDIT 3: 5.12.0.3 CE - still the same behaviour.

Steps to reproduce:
see above

Current results:

Expected results:

It seems you are looking for CLUSTER_IDS, more information here (look at the example):

https://docs.opennebula.io/5.12/operation/network_management/vn_templates.html#virtual-network-template-definition

Rubén, thanks for the hint. After adding CLUSTER_IDS="101" to the template file, I can create the template using onevntemplate create, and after instantiation, the resulting VNet gets correctly assigned to the cluster 101:

NAME="VXLAN test"
AUTOMATIC_VLAN_ID="YES"
CLUSTER_IDS="101"
FILTER_MAC_SPOOFING="YES"
GUEST_MTU="1500"
INBOUND_AVG_BW="100000"
OUTBOUND_AVG_BW="100000"
PHYDEV="eth1"
VN_MAD="vxlan"

However, there are still problems with Sunstone: the template in my first post was entirely created by Sunstone (5.12.0.1), apart from adding the CLUSTERS parameter manually afterwards, as I describe in the previous post. So there is definitely a bug in Sunstone that it does not create a correct cluster assignmnent in the VNet template.

For 5.12.0.3, I am not even able to create the template described above in Sunstone - it complains that the Physical device field with value eth1 is filled incorrectly: One or more required fields are missing or malformed. It complains even when I try to update the existing template created from file using onevntemplate, do not modify anything, and click on the Update again. The PHYDEV=eth1 field onevntemplate accepts, is not accepted by Sunstone.

In Sunstone view of this template, there are no clusters selected neither in the Clusters tab, nor when I click to Select cluster. In the Info tab, there is CLUSTER_IDS=101 parameter, but it seems that Sunstone is trying to use something else in its Clusters tab.

Thanks!

-Yenya

Created an issue at Github: