Exemplo n.º 1
0
 def verify_vm_not_in_vcenter(self, vrouter_ip,vm_name, *args):
     #everytime verify_vm_in_vcenter should be called with introspect refreshe
     self.get_introspect(vrouter_ip)
     vm_details = vmware_introspect_utils.get_vm_details(self.vcntr_introspect, vm_name)
     try:
         if vm_details.virtual_machine:
             self.logger.error("VM is still there...")
             return False
     except Exception as e:
         self.logger.error(e)
         return True
Exemplo n.º 2
0
 def verify_vm_not_in_vcenter(self, vrouter_ip,vm_name, *args):
    	#everytime verify_vm_in_vcenter should be called with introspect refreshe
    self.get_introspect(vrouter_ip)
    vm_details = vmware_introspect_utils.get_vm_details(self.vcntr_introspect, vm_name)
    try:
        if vm_details.virtual_machine:
            self.logger.error("VM is still there...")
            return False
    except Exception as e:
        self.logger.error(e)
        return True
Exemplo n.º 3
0
    def verify_vm_in_vcenter(self, vrouter_ip,vm_name, *args):

       #everytime verify_vm_in_vcenter should be called with introspect refreshed
       self.get_introspect(vrouter_ip)
       vm_details = vmware_introspect_utils.get_vm_details(self.vcntr_introspect, vm_name)
       try:
           if vm_details.virtual_machine:
               for elem in vm_details.virtual_machine['list']:
                   if 'ip_address' in elem and elem['ip_address']:
                       return True
                   else:
                       self.logger.error("VM did not get an ip address yet...")
                       return False
           self.logger.error("VM not yet launched...")
           return False
       except Exception as e:
           self.logger.error(e)
           return False
Exemplo n.º 4
0
    def verify_vm_in_vcenter(self, vrouter_ip,vm_name, *args):

       #everytime verify_vm_in_vcenter should be called with introspect refreshed
       self.get_introspect(vrouter_ip)
       vm_details = vmware_introspect_utils.get_vm_details(self.vcntr_introspect, vm_name)
       try:
           if vm_details.virtual_machine:
               for elem in vm_details.virtual_machine['list']:
                   if 'ip_address' in elem and elem['ip_address']:
                       return True
                   else:
                       self.logger.error("VM did not get an ip address yet...")
                       return False
           self.logger.error("VM not yet launched...")
           return False
       except Exception as e:
           self.logger.error(e)
           return False
 def get_vmi_from_vcenter_introspect(self, vrouter_ip, vm_name, *args):
     intfs = []
     self.get_introspect(vrouter_ip)
     vm_details = vmware_introspect_utils.get_vm_details(
         self.vcntr_introspect, vm_name)
     return vm_details.virtual_machine['interfaces']
Exemplo n.º 6
0
 def get_vmi_from_vcenter_introspect(self, vrouter_ip,vm_name, *args):
    intfs = []
    self.get_introspect(vrouter_ip)
    vm_details = vmware_introspect_utils.get_vm_details(self.vcntr_introspect, vm_name)
    return vm_details.virtual_machine['interfaces']