destroy the given vm
        :param si:      pyvmomi 'ServiceInstance'
        :param vm_uuid: str uuid of the vm to destroyed
        :param vm_path: str path to the vm that will be destroyed
        :param logger:
761930
def destroy_vm_by_uuid(self, si, vm_uuid, vm_path, logger):
        
        if vm_uuid is not None:
            vm = self.find_by_uuid(si, vm_uuid, vm_path)
            if vm:
                return self.destroy_vm(vm, logger)
        # return 'vm not found'
        # for apply the same Interface as for 'destroy_vm_by_name'
        raise ValueError('vm not found')
1357202
def destroy(name, conn=None, call=None):
    '''
    
    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'The destroy action must be called with -d, --destroy, '
            '-a or --action.'
        )

    __utils__['cloud.fire_event'](
        'event',
        'destroying instance',
        'salt/cloud/{0}/destroying'.format(name),
        sock_dir=__opts__['sock_dir'],
        args={'name': name},
    )

    if not conn:
        conn = get_conn()   # pylint: disable=E0602

    node = get_node(conn, name)
    if node is None:
        log.error('Unable to find the VM %s', name)
    volumes = conn.list_volumes(node)
    if volumes is None:
        log.error('Unable to find volumes of the VM %s', name)
    # TODO add an option like 'delete_sshkeys' below
    for volume in volumes:
        if volume.extra['volume_type'] != 'DATADISK':
            log.info(
                'Ignoring volume type %s: %s',
                volume.extra['volume_type'], volume.name
            )
            continue
        log.info('Detaching volume: %s', volume.name)
        __utils__['cloud.fire_event'](
            'event',
            'detaching volume',
            'salt/cloud/{0}/detaching'.format(volume.name),
            sock_dir=__opts__['sock_dir'],
            args={'name': volume.name},
        )
        if not conn.detach_volume(volume):
            log.error('Failed to Detach volume: %s', volume.name)
            return False
        log.info('Detached volume: %s', volume.name)
        __utils__['cloud.fire_event'](
            'event',
            'detached volume',
            'salt/cloud/{0}/detached'.format(volume.name),
            sock_dir=__opts__['sock_dir'],
            args={'name': volume.name},
        )

        log.info('Destroying volume: %s', volume.name)
        __utils__['cloud.fire_event'](
            'event',
            'destroying volume',
            'salt/cloud/{0}/destroying'.format(volume.name),
            sock_dir=__opts__['sock_dir'],
            args={'name': volume.name},
        )
        if not conn.destroy_volume(volume):
            log.error('Failed to Destroy volume: %s', volume.name)
            return False
        log.info('Destroyed volume: %s', volume.name)
        __utils__['cloud.fire_event'](
            'event',
            'destroyed volume',
            'salt/cloud/{0}/destroyed'.format(volume.name),
            sock_dir=__opts__['sock_dir'],
            args={'name': volume.name},
        )
    log.info('Destroying VM: %s', name)
    ret = conn.destroy_node(node)
    if not ret:
        log.error('Failed to Destroy VM: %s', name)
        return False
    log.info('Destroyed VM: %s', name)
    # Fire destroy action
    event = salt.utils.event.SaltEvent('master', __opts__['sock_dir'])
    __utils__['cloud.fire_event'](
        'event',
        'destroyed instance',
        'salt/cloud/{0}/destroyed'.format(name),
        sock_dir=__opts__['sock_dir'],
        args={'name': name},
    )
    if __opts__['delete_sshkeys'] is True:
        salt.utils.cloud.remove_sshkey(node.public_ips[0])
    return True
1056671
def stop_vm(self):
        
        if self.vagrant is not None:
            if self.destroy:
                self.vagrant.destroy()
                shutil.rmtree(self.vagrant.root, ignore_errors=True)
                self.vagrant = None
            else:
                self.vagrant.halt()
50226
def shutdown(self):
        
        vm = self.get_vm_failfast(self.config['name'])

        if vm.runtime.powerState == vim.VirtualMachinePowerState.poweredOff:
            print("%s already poweredOff" % vm.name)
        else:
            if self.guestToolsRunning(vm):
                timeout_minutes = 10
                print("waiting for %s to shutdown "
                      "(%s minutes before forced powerOff)" % (
                          vm.name,
                          str(timeout_minutes)
                      ))
                vm.ShutdownGuest()
                if self.WaitForVirtualMachineShutdown(vm,
                                                      timeout_minutes * 60):
                    print("shutdown complete")
                    print("%s poweredOff" % vm.name)
                else:
                    print("%s has not shutdown after %s minutes:"
                          "will powerOff" % (vm.name, str(timeout_minutes)))
                    self.powerOff()

            else:
                print("GuestTools not running or not installed: will powerOff")
                self.powerOff()
523538
def destroy(self):
        
        self.stop()
        if self.base_pathname is not None:
            self._robust_remove(self.base_pathname)
1329811
def project_destroy(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/destroy' % object_id, input_params, always_retry=always_retry, **kwargs)
1350612
def destroy_s3(app='', env='dev', **_):
    
    session = boto3.Session(profile_name=env)
    client = session.resource('s3')

    generated = get_details(app=app, env=env)
    archaius = generated.archaius()

    bucket = client.Bucket(archaius['bucket'])

    for item in bucket.objects.filter(Prefix=archaius['path']):
        item.Object().delete()
        LOG.info('Deleted: %s/%s', item.bucket_name, item.key)

    return True
378978
def reset(vm_):
    '''
    
    '''
    with _get_xapi_session() as xapi:
        vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
        if vm_uuid is False:
            return False
        try:
            xapi.VM.hard_reboot(vm_uuid)
            return True
        except Exception:
            return False
241267
def DeleteInstance(self, si, logger, session, vcenter_data_model, vm_uuid, vm_name):
        
        # find vm
        vm = self.pv_service.find_by_uuid(si, vm_uuid)
        if vm is not None:
            # destroy vm
            result = self.pv_service.destroy_vm(vm=vm, logger=logger)
        else:
            resource___format = "Could not find the VM {0},will remove the resource.".format(vm_name)
            logger.info(resource___format)
            result = resource___format

        return result
1090778
def destroy(self, si, logger, session, vcenter_data_model, vm_uuid, vm_name, reservation_id):
        
        # disconnect
        self._disconnect_all_my_connectors(session=session, resource_name=vm_name, reservation_id=reservation_id,
                                           logger=logger)
        # find vm
        vm = self.pv_service.find_by_uuid(si, vm_uuid)

        if vm is not None:
            # destroy vm
            result = self.pv_service.destroy_vm(vm=vm, logger=logger)
        else:
            logger.info("Could not find the VM {0},will remove the resource.".format(vm_name))
            result = True

        # delete resources
        self.resource_remover.remove_resource(session=session, resource_full_name=vm_name)
        return result
708784
def delete_service(resource_root, name, cluster_name="default"):
  
  return call(resource_root.delete,
      "%s/%s" % (SERVICES_PATH % (cluster_name,), name),
      ApiService)
789111
def load_vm_uuid_by_name(self, si, vcenter_data_model, vm_name):
        
        path = VMLocation.combine([vcenter_data_model.default_datacenter, vm_name])
        paths = path.split('/')
        name = paths[len(paths) - 1]
        path = VMLocation.combine(paths[:len(paths) - 1])
        vm = self.pv_service.find_vm_by_name(si, path, name)
        if not vm:
            raise ValueError('Could not find the vm in the given path: {0}/{1}'.format(path, name))

        if isinstance(vm, vim.VirtualMachine):
            return vm.config.uuid

        raise ValueError('The given object is not a vm: {0}/{1}'.format(path, name))
786502
def destroy
      #disks = vm_object.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)
      unless host.free_license
        vm_object.Destroy_Task.wait_for_completion
      else
        host.remote_command "vim-cmd vmsvc/power.off #{vmid}"
        host.remote_command "vim-cmd vmsvc/destroy #{vmid}"
      end
    end
402336
def destroy(name, call=None):
    '''
    
    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'The destroy action must be called with -d, --destroy, '
            '-a or --action.'
        )

    __utils__['cloud.fire_event'](
        'event',
        'destroying instance',
        'salt/cloud/{0}/destroying'.format(name),
        args={'name': name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    node = show_instance(name, call='action')
    if node['state'] == 'STARTED':
        stop(name, call='action')
        if not wait_until(name, 'STOPPED'):
            return {
                'Error': 'Unable to destroy {0}, command timed out'.format(
                    name
                )
            }

    data = query(action='ve', command=name, method='DELETE')

    if 'error' in data:
        return data['error']

    __utils__['cloud.fire_event'](
        'event',
        'destroyed instance',
        'salt/cloud/{0}/destroyed'.format(name),
        args={'name': name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    if __opts__.get('update_cachedir', False) is True:
        __utils__['cloud.delete_minion_cachedir'](name, __active_provider_name__.split(':')[0], __opts__)

    return {'Destroyed': '{0} was destroyed.'.format(name)}
266632
def destroy(name, call=None):
    '''
    
    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'The destroy action must be called with -d, --destroy, '
            '-a or --action.'
        )

    __utils__['cloud.fire_event'](
        'event',
        'destroying instance',
        'salt/cloud/{0}/destroying'.format(name),
        args={'name': name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    instanceId = _get_node(name)['InstanceId']

    # have to stop instance before del it
    stop_params = {
        'Action': 'StopInstance',
        'InstanceId': instanceId
    }
    query(stop_params)

    params = {
        'Action': 'DeleteInstance',
        'InstanceId': instanceId
    }

    node = query(params)

    __utils__['cloud.fire_event'](
        'event',
        'destroyed instance',
        'salt/cloud/{0}/destroyed'.format(name),
        args={'name': name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    return node
203222
def delete(self, resource, resource_id):
        '''
        
        '''

        service_def, resource_def, path = self._get_service_information(
            resource)
        delete_path = "{0}{1}/" . format(path, resource_id)
        return self.call(path=delete_path, method="delete")
310098
def destroy(self):
        

        # if this unit didn't come from fleet, we can't destroy it
        if not self._is_live():
            raise RuntimeError('A unit must be submitted to fleet before it can destroyed.')

        return self._client.destroy_unit(self.name)