Example #1
0
 def get_vm_os_details(self):
     """
     This method returns the virtual machine operating system details.
     """
     try:
         #Step1: Parse the config file and read the config details
         vd = parse_vm_config(vm_dir=self.vm_path)
         self.config_details = vd.vm_read_config()
         #Step2: Get the virtual machine disk file paths
         primary_disk = vd.vm_get_primary_disk()
         #Step3: For each disk in the list mount and get the os details
         #       if any.
         for disk in primary_disk:
             os_details = None
             if os.path.exists(os.path.join(self.vm_path, disk)):
                 try:
                     #Step4: Mount the virtual machine disk.
                     #self.disk.vm_mount(os.path.join(self.vm_path, disk))
                     #vm_mntpt =  self.disk.get_mountpoint()
                     #Step5: Get the machine internal details.
                     os_profile = get_os_info(fs_mountpoint=\
                             os.path.join(self.vm_path, disk),
                             bin_dir=self.bin_dir)
                     os_details = os_profile.get_os_details()
                     if os_details:
                         self.os_details = os_details
                         break
                 except Exception, e:
                     logging.error(str(e))
                     self.disk.vm_umount()
     except Exception, e:
         raise vm_inspector_error(str(e))
Example #2
0
 def get_vm_os_details(self):
     """
     This method returns the virtual machine operating system details.
     """
     try:
         # Step1: Parse the config file and read the config details
         vd = parse_vm_config(vm_dir=self.vm_path)
         self.config_details = vd.vm_read_config()
         # Step2: Get the virtual machine disk file paths
         primary_disk = vd.vm_get_primary_disk()
         # Step3: For each disk in the list mount and get the os details
         #       if any.
         for disk in primary_disk:
             os_details = None
             if os.path.exists(os.path.join(self.vm_path, disk)):
                 try:
                     # Step4: Mount the virtual machine disk.
                     # self.disk.vm_mount(os.path.join(self.vm_path, disk))
                     # vm_mntpt =  self.disk.get_mountpoint()
                     # Step5: Get the machine internal details.
                     os_profile = get_os_info(fs_mountpoint=os.path.join(self.vm_path, disk), bin_dir=self.bin_dir)
                     os_details = os_profile.get_os_details()
                     if os_details:
                         self.os_details = os_details
                         break
                 except Exception, e:
                     logging.error(str(e))
                     self.disk.vm_umount()
     except Exception, e:
         raise vm_inspector_error(str(e))
Example #3
0
 def get_vm_config_details(self):
     """
     This method returns the virtual machine configuration details.
     """
     try:
         #Step1: Parse the config file and read the config details
         vd = parse_vm_config(vm_dir=self.vm_path)
         self.config_details = vd.vm_read_config()
     except Exception, e:
         raise vm_inspector_error(str(e))
Example #4
0
 def get_vm_config_details(self):
     """
     This method returns the virtual machine configuration details.
     """
     try:
         # Step1: Parse the config file and read the config details
         vd = parse_vm_config(vm_dir=self.vm_path)
         self.config_details = vd.vm_read_config()
     except Exception, e:
         raise vm_inspector_error(str(e))