@@ -85,16 +85,13 @@ class OpenStackHandler(SourceBase):
8585 "user_domain" : None ,
8686 "project_domain" : None ,
8787 "group_name" : "Openstack" ,
88- "validate_tls_certs " : False ,
88+ "permitted_subnets " : None ,
8989 "cluster_exclude_filter" : None ,
9090 "cluster_include_filter" : None ,
9191 "host_exclude_filter" : None ,
9292 "host_include_filter" : None ,
9393 "vm_exclude_filter" : None ,
9494 "vm_include_filter" : None ,
95- "permitted_subnets" : None ,
96- "collect_hardware_asset_tag" : True ,
97- "match_host_by_serial" : True ,
9895 "cluster_site_relation" : None ,
9996 "cluster_tag_relation" : None ,
10097 "cluster_tenant_relation" : None ,
@@ -108,14 +105,12 @@ class OpenStackHandler(SourceBase):
108105 "vm_tenant_relation" : None ,
109106 "dns_name_lookup" : False ,
110107 "custom_dns_servers" : None ,
108+ "validate_tls_certs" : False ,
111109 "set_primary_ip" : "when-undefined" ,
110+ "skip_vm_platform" : False ,
112111 "skip_vm_comments" : False ,
113- "skip_vm_templates" : True ,
114112 "strip_host_domain_name" : False ,
115- "strip_vm_domain_name" : False ,
116- "sync_tags" : False ,
117- "sync_parent_tags" : False ,
118- "sync_custom_attributes" : False
113+ "strip_vm_domain_name" : False
119114 }
120115
121116 deprecated_settings = {}
@@ -652,8 +647,7 @@ def add_device_vm_to_inventory(self, object_type, object_data, pnic_data=None, v
652647 Try to find object first based on the object data, interface MAC addresses and primary IPs.
653648 1. try to find by name and cluster/site
654649 2. try to find by mac addresses interfaces
655- 3. try to find by serial number (1st) or asset tag (2nd) (ESXi host)
656- 4. try to find by primary IP
650+ 3. try to find by primary IP
657651
658652 IP addresses for each interface are added here as well. First they will be checked and added
659653 if all checks pass. For each IP address a matching IP prefix will be searched for. First we
@@ -742,21 +736,6 @@ def add_device_vm_to_inventory(self, object_type, object_data, pnic_data=None, v
742736
743737 device_vm_object = self .get_object_based_on_macs (object_type , nic_macs )
744738
745- # look for devices with same serial or asset tag
746- if object_type == NBDevice :
747-
748- if device_vm_object is None and object_data .get ("serial" ) is not None and \
749- bool (self .match_host_by_serial ) is True :
750- log .debug2 (f"No match found. Trying to find { object_type .name } based on serial number" )
751-
752- device_vm_object = self .inventory .get_by_data (object_type , data = {"serial" : object_data .get ("serial" )})
753-
754- if device_vm_object is None and object_data .get ("asset_tag" ) is not None :
755- log .debug2 (f"No match found. Trying to find { object_type .name } based on asset tag" )
756-
757- device_vm_object = self .inventory .get_by_data (object_type ,
758- data = {"asset_tag" : object_data .get ("asset_tag" )})
759-
760739 if device_vm_object is not None :
761740 log .debug2 ("Found a matching %s object: %s" %
762741 (object_type .name , device_vm_object .get_display_name (including_second_key = True )))
@@ -919,13 +898,8 @@ def add_host(self, obj):
919898 does the host pass the host_include_filter and host_exclude_filter
920899
921900 Then all necessary host data will be collected.
922- host model, manufacturer, serial, physical interfaces, virtual interfaces,
923- virtual switches, proxy switches, host port groups, interface VLANs, IP addresses
924901
925- Primary IPv4/6 will be determined by
926- 1. if the interface port group name contains
927- "management" or "mngt"
928- 2. interface is the default route of this host
902+ Primary IPv4/6 will be determined by 'host_ip' value
929903
930904 Parameters
931905 ----------
@@ -1005,9 +979,6 @@ def add_host(self, obj):
1005979 if get_string_or_none (obj .status ) == "enabled" :
1006980 status = "active"
1007981
1008- # add asset tag if desired and present
1009- asset_tag = None
1010-
1011982 # get host_tenant_relation
1012983 tenant_name = self .get_object_relation (name , "host_tenant_relation" )
1013984
@@ -1029,8 +1000,6 @@ def add_host(self, obj):
10291000 }
10301001
10311002 # add data if present
1032- if asset_tag is not None :
1033- host_data ["asset_tag" ] = asset_tag
10341003 if platform is not None :
10351004 host_data ["platform" ] = {"name" : platform }
10361005 if tenant_name is not None :
@@ -1078,7 +1047,6 @@ def add_virtual_machine(self, obj):
10781047 # get VM power state
10791048 status = "active" if get_string_or_none (obj .status ) == "ACTIVE" else "offline"
10801049
1081- # hypervisor_name = get_string_or_none(obj.hypervisor_hostname)
10821050 cluster_name = get_string_or_none (obj .availability_zone )
10831051
10841052 # honor strip_host_domain_name
@@ -1113,16 +1081,13 @@ def add_virtual_machine(self, obj):
11131081 # Collect data
11141082 #
11151083
1116- # check if cluster is a Standalone ESXi
1117- site_name = self .permitted_clusters .get (cluster_name )
1118- if site_name is None :
1119- site_name = self .get_site_name (NBCluster , cluster_name )
1120-
11211084 # first check against vm_platform_relation
1122- platform = get_string_or_none (obj .flavor ["original_name" ])
1085+ platform = None
1086+ if bool (self .skip_vm_platform ) is False :
1087+ platform = get_string_or_none (obj .flavor ["original_name" ])
11231088
1124- if platform is not None :
1125- platform = self .get_object_relation (platform , "vm_platform_relation" , fallback = platform )
1089+ if platform is not None :
1090+ platform = self .get_object_relation (platform , "vm_platform_relation" , fallback = platform )
11261091
11271092 disk = 0
11281093 for volume in obj .attached_volumes :
0 commit comments