diff --git a/packer_files/vsphere_centos_template/variables.pkr.hcl b/packer_files/vsphere_centos_template/variables.pkr.hcl index 7d6daede6a7..173b5160ffa 100644 --- a/packer_files/vsphere_centos_template/variables.pkr.hcl +++ b/packer_files/vsphere_centos_template/variables.pkr.hcl @@ -76,7 +76,7 @@ variable "iso_url" { variable "iso_checksum" { type = string - default = "9602c69c52d93f51295c0199af395ca0edbe35e36506e32b8e749ce6c8f5b60a" + default = "9602c69c52d93f51295c0199af395ca0edbe35e3650632b8e749ce6c8f5b60a" description = "The Centos8 ISO checksum" } diff --git a/src/assisted_test_infra/test_infra/controllers/node_controllers/nutanix_controller.py b/src/assisted_test_infra/test_infra/controllers/node_controllers/nutanix_controller.py index 37d5c16eef0..6adfd1f3137 100644 --- a/src/assisted_test_infra/test_infra/controllers/node_controllers/nutanix_controller.py +++ b/src/assisted_test_infra/test_infra/controllers/node_controllers/nutanix_controller.py @@ -56,7 +56,17 @@ def restart_node(self, node_name: str) -> None: vm.power_on() def get_ingress_and_api_vips(self): - if not self._entity_config.vip_dhcp_allocation: + """ + Need to distinguish between 3 cases: + 1) vip_dhcp_allocation is set to False: Need to provide API and Ingress VIPs - raise an exception if + one or more are empty. + 2) vip_dhcp_allocation is set to True: No need to provide API and Ingress VIP, return None. + 3) vip_dhcp_allocation is not being set at all and its value is equal to None: In this case, search free IPs + and set them as VIPs. The behavior is the same as vip_dhcp_allocation = False but getting the IPs first. + Note that (3) is supposed to happen only locally due to the face that vip_dhcp_allocation is set in CI to some + value. + """ + if self._entity_config.vip_dhcp_allocation is False: if self._entity_config.api_vips is None or len(self._entity_config.api_vips) == 0: raise ValueError("API VIP is not set") if self._entity_config.ingress_vips is None or len(self._entity_config.ingress_vips) == 0: @@ -66,6 +76,10 @@ def get_ingress_and_api_vips(self): "ingress_vips": self._entity_config.ingress_vips, } + elif self._entity_config.vip_dhcp_allocation is True: + return None + + # If VIP DHCP Allocation is not set at all - search for free IPs and select addresses for VIPs nutanix_subnet = next( s for s in NutanixSubnet.list_entities(self._provider_client) if s.name == self._config.nutanix_subnet ) @@ -91,7 +105,7 @@ def get_ingress_and_api_vips(self): raise ConnectionError("Failed to locate free API and Ingress VIPs") log.info(f"Found 2 optional VIPs: {free_ips}") - return {"api_vips": [free_ips.pop()], "ingress_vips": [free_ips.pop()]} + return {"api_vips": [{"ip": free_ips.pop()}], "ingress_vips": [{"ip": free_ips.pop()}]} def set_boot_order(self, node_name, cd_first=False, cdrom_iso_path=None) -> None: vm = self._get_provider_vm(tf_vm_name=node_name)