def destroy(self, instance, network_info):
        try:
            vm_ref = self._get_vm_ref_from_the_name(instance.name)
            if vm_ref is None:
                LOG.debug(_("instance - %s not present") % instance.name)
                return
            lst_properties = ["config.files.vmPathName", "runtime.powerState"]
            props = self._session._call_method(vim_util,
                        "get_object_properties",
                        None, vm_ref, "VirtualMachine", lst_properties)
            pwr_state = None
            for elem in props:
                vm_config_pathname = None
                for prop in elem.propSet:
                    if prop.name == "runtime.powerState":
                        pwr_state = prop.val
                    elif prop.name == "config.files.vmPathName":
                        vm_config_pathname = prop.val
            if vm_config_pathname:
                datastore_name, vmx_file_path = \
                            vm_util.split_datastore_path(vm_config_pathname)
            # Power off the VM if it is in PoweredOn state.
            if pwr_state == "poweredOn":
                LOG.debug(_("Powering off the VM %s") % instance.name)
                poweroff_task = self._session._call_method(
                       self._session._get_vim(),
                       "PowerOffVM_Task", vm_ref)
                self._session._wait_for_task(instance.id, poweroff_task)
                LOG.debug(_("Powered off the VM %s") % instance.name)

            # Un-register the VM
            try:
                LOG.debug(_("Unregistering the VM %s") % instance.name)
                self._session._call_method(self._session._get_vim(),
                        "UnregisterVM", vm_ref)
                LOG.debug(_("Unregistered the VM %s") % instance.name)
            except Exception, excep:
                LOG.warn(_("In vmwareapi:vmops:destroy, got this exception"
                           " while un-registering the VM: %s") % str(excep))

            self._unplug_vifs(instance, network_info)

            # Delete the folder holding the VM related content on
            # the datastore.
            try:
                dir_ds_compliant_path = vm_util.build_datastore_path(
                                 datastore_name,
                                 os.path.dirname(vmx_file_path))
                LOG.debug(_("Deleting contents of the VM %(name)s from "
                            "datastore %(datastore_name)s") %
                           ({'name': instance.name,
                             'datastore_name': datastore_name}))
                delete_task = self._session._call_method(
                    self._session._get_vim(),
                    "DeleteDatastoreFile_Task",
                    self._session._get_vim().get_service_content().fileManager,
                    name=dir_ds_compliant_path)
                self._session._wait_for_task(instance.id, delete_task)
                LOG.debug(_("Deleted contents of the VM %(name)s from "
                            "datastore %(datastore_name)s") %
                           ({'name': instance.name,
                             'datastore_name': datastore_name}))
            except Exception, excep:
                LOG.warn(_("In vmwareapi:vmops:destroy, "
                             "got this exception while deleting"
                             " the VM contents from the disk: %s")
                             % str(excep))
        except Exception, exc:
            LOG.exception(exc)
The field options are set using the key 'options'.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/virt/vmwareapi/vmops.py/VMWareVMOps.destroy--crossover with--dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_data_form.py/FieldTest.test_fromDictOptions