def _create_vrouter_for_vm(self, vmi, vm): vrouter_obj = VirtualRouter('phys-host-1' + vmi.uuid, virtual_router_ip_address = self.get_kubernetes_node_ip()) self._vnc_lib.virtual_router_create(vrouter_obj) vrouter_obj = self._vnc_lib.virtual_router_read( fq_name=vrouter_obj.get_fq_name()) VirtualRouterKM.locate(vrouter_obj.get_uuid(), vrouter_obj) vrouter_obj.set_virtual_machine(vm) self._vnc_lib.virtual_router_update(vrouter_obj) return vrouter_obj
def create_virtual_router(cls, name, node_ip=None): vrouter_node_ip = node_ip if node_ip else cls.get_kubernetes_node_ip() vrouter_obj = VirtualRouter(name, virtual_router_ip_address=vrouter_node_ip) try: vrouter_obj = cls._vnc_lib.virtual_router_read( fq_name=vrouter_obj.get_fq_name()) except NoIdError: cls._vnc_lib.virtual_router_create(vrouter_obj) VirtualRouterKM.locate(vrouter_obj.uuid) return vrouter_obj
def _create_vrouter_for_vm(self, vmi, vm): vrouter_obj = VirtualRouter('phys-host-1' + vmi.uuid, virtual_router_ip_address = self.get_kubernetes_node_ip()) self._vnc_lib.virtual_router_create(vrouter_obj) vrouter_obj = self._vnc_lib.virtual_router_read( fq_name=vrouter_obj.get_fq_name()) VirtualRouterKM.locate(vrouter_obj.get_uuid(), vrouter_obj) vrouter_obj.set_virtual_machine(vm) self._vnc_lib.virtual_router_update(vrouter_obj) return vrouter_obj
def create_virtual_router(cls, name, node_ip=None): vrouter_node_ip = node_ip if node_ip else cls.get_kubernetes_node_ip() vrouter_obj = VirtualRouter( name, virtual_router_ip_address=vrouter_node_ip) try: vrouter_obj = cls._vnc_lib.virtual_router_read( fq_name=vrouter_obj.get_fq_name()) except NoIdError: cls._vnc_lib.virtual_router_create(vrouter_obj) VirtualRouterKM.locate(vrouter_obj.uuid) return vrouter_obj