def write_ovf_descriptor(self, ovf_files):
        """
        Query vCenter for ovf descriptor information, and write it to a file
        :param ovf_files:
        :return:
        """
        print 'Getting OVF Manager'
        ovf_manager = self.vcenter_conn.content.ovfManager
        print 'Creating OVF Descriptor'
        ovf_parameters = vim.OvfManager.CreateDescriptorParams()
        ovf_parameters.name = self.name
        ovf_parameters.ovfFiles = ovf_files
        vm_descriptor_result = ovf_manager.CreateDescriptor(obj=self.vm_obj,
                                                            cdp=ovf_parameters)
        if vm_descriptor_result.error:
            raise vm_descriptor_result.error[0].fault
        else:
            vm_descriptor = vm_descriptor_result.ovfDescriptor
            target_ovf_descriptor_path = os.path.join(self.vm_dl_path,
                                                      self.name + '.ovf')
            print 'Writing OVF Descriptor {}'.format(
                target_ovf_descriptor_path)
            with open(target_ovf_descriptor_path, 'wb') as handle:
                handle.write(vm_descriptor)
def write_ovf_descriptor ( self , ovf_files ) : print 'Getting OVF Manager' ovf_manager = self . vcenter_conn . content . ovfManager print 'Creating OVF Descriptor' ovf_parameters = vim . OvfManager . CreateDescriptorParams ( ) ovf_parameters . name = self . name ovf_parameters . ovfFiles = ovf_files vm_descriptor_result = ovf_manager . CreateDescriptor ( obj = self . vm_obj , cdp = ovf_parameters ) if vm_descriptor_result . error : raise vm_descriptor_result . error [ 0 ] . fault else : vm_descriptor = vm_descriptor_result . ovfDescriptor target_ovf_descriptor_path = os . path . join ( self . vm_dl_path , self . name + '.ovf' ) print 'Writing OVF Descriptor {}' . format ( target_ovf_descriptor_path ) with open ( target_ovf_descriptor_path , 'wb' ) as handle : handle . write ( vm_descriptor )
Query vCenter for ovf descriptor information, and write it to a file
        :param ovf_files:
        :return: