Shutdown this VM
        :param delete: Should we delete after shutting the VM down?
        :type delete: bool
967656
def shutdown(self, delete=False):
        
        disks = self.get_disks()
        self.domain.destroy()
        if delete:
            for disk in disks:
                disk.wipe()
                disk.delete()
1016511
def close(self, for_shutdown=False, **_kwargs):
        
        if for_shutdown:
            super(PySOAPyLibMCCache, self).close()
488154
def stop(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_shutdown(vm_uuid)
            return True
        except Exception:
            return False
485880
def close(self):
        
        if self.handle:
            q = lvm_quit(self.handle)
            if q != 0:
                raise HandleError("Failed to close LVM handle.")
            self.__handle = None
1122841
def delete_server(name, expunge)
      server = get_server(name)
      if !server || !server['id'] then
        puts "\nError: Virtual machine '#{name}' does not exist"
        exit 1
      end

      params = {
          'command' => 'destroyVirtualMachine',
          'id' => server['id'],
          'expunge' => expunge
      }

      json = send_async_request(params)
      json['virtualmachine']
    end
5600
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']
    )

    vm_properties = [
        "name",
        "summary.runtime.powerState"
    ]

    vm_list = salt.utils.vmware.get_mors_with_properties(_get_si(), vim.VirtualMachine, vm_properties)

    for vm in vm_list:
        if vm["name"] == name:
            if vm["summary.runtime.powerState"] != "poweredOff":
                # Power off the vm first
                try:
                    log.info('Powering Off VM %s', name)
                    task = vm["object"].PowerOff()
                    salt.utils.vmware.wait_for_task(task, name, 'power off')
                except Exception as exc:
                    log.error(
                        'Error while powering off VM %s: %s',
                        name, exc,
                        # Show the traceback if the debug logging level is enabled
                        exc_info_on_loglevel=logging.DEBUG
                    )
                    return 'failed to destroy'
            try:
                log.info('Destroying VM %s', name)
                task = vm["object"].Destroy_Task()
                salt.utils.vmware.wait_for_task(task, name, 'destroy')
            except Exception as exc:
                log.error(
                    'Error while destroying VM %s: %s',
                    name, exc,
                    # Show the traceback if the debug logging level is enabled
                    exc_info_on_loglevel=logging.DEBUG
                )
                return 'failed to destroy'

    __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 True
536973
def clean_delete(self):
        

        yield from self._hypervisor.send('vm clean_delete "{}"'.format(self._name))
        self._hypervisor.devices.remove(self)
        try:
            yield from wait_run_in_executor(shutil.rmtree, self._working_directory)
        except OSError as e:
            log.warn("Could not delete file {}".format(e))
        log.info('Router "{name}" [{id}] has been deleted (including associated files)'.format(name=self._name, id=self._id))
810390
def delete(self, session, commit=True, soft=True):
        
        if soft:
            self.time_removed = sqlalchemy.func.unix_timestamp()
        else:
            session.delete(self)

        if commit:
            session.commit()
1305700
protected void didShutdown ()
    {
        // clear out our listenership
        _plobj.removeListener(this);
        _plobj.removeListener(_bodyUpdater);
        _plobj.removeListener(_occListener);
        _plobj.removeListener(_deathListener);

        // clear out our invocation service registrations
        for (InvocationMarshaller<?> marsh : _marshallers) {
            _invmgr.clearDispatcher(marsh);
        }

        // let our delegates know that we've shut down
        applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) {
            @Override
            public void apply (PlaceManagerDelegate delegate) {
                delegate.didShutdown();
            }
        });

        // if shutting down emptied the place and scheduled the shutdowner, clear that out
        cancelShutdowner();
    }
799980
def delete(self):
        
        req = self.request(self.mist_client.uri + '/clouds/' + self.id)
        req.delete()
        self.mist_client.update_clouds()
601057
async def delete(self, device, remove=True):
        
        device = self._find_device(device)
        if not self.is_handleable(device) or not device.is_loop:
            self._log.warn(_('not deleting {0}: unhandled device', device))
            return False
        if remove:
            await self.auto_remove(device, force=True)
        self._log.debug(_('deleting {0}', device))
        await device.delete()
        self._log.info(_('deleted {0}', device))
        return True
1270565
static void close(boolean delete) {
        if (openedFile != null) {
            out.close();
            out = System.err;

            if (delete) {
                openedFile.delete();
            }
        }
    }
1099769
def _delete(self, *args, **kwargs):
        
        response = requests.delete(*args, **kwargs)
        response.raise_for_status()
513501
def destroy(vm_, call=None):
    ''''''
    destroy_opt = __opts__.get('destroy', False)
    profiles = __opts__.get('profiles', {})
    profile = __opts__.get('profile',
                           __opts__.get('internal_lxc_profile', []))
    path = None
    if profile and profile in profiles:
        path = profiles[profile].get('path', None)
    action = __opts__.get('action', '')
    if action != 'destroy' and not destroy_opt:
        raise SaltCloudSystemExit(
            'The destroy action must be called with -d, --destroy, '
            '-a or --action.'
        )
    if not get_configured_provider():
        return
    ret = {'comment': '{0} was not found'.format(vm_),
           'result': False}
    if _salt('lxc.info', vm_, path=path):
        __utils__['cloud.fire_event'](
            'event',
            'destroying instance',
            'salt/cloud/{0}/destroying'.format(vm_),
            args={'name': vm_, 'instance_id': vm_},
            sock_dir=__opts__['sock_dir'],
            transport=__opts__['transport']
        )
        cret = _salt('lxc.destroy', vm_, stop=True, path=path)
        ret['result'] = cret['result']
        if ret['result']:
            ret['comment'] = '{0} was destroyed'.format(vm_)
            __utils__['cloud.fire_event'](
                'event',
                'destroyed instance',
                'salt/cloud/{0}/destroyed'.format(vm_),
                args={'name': vm_, 'instance_id': vm_},
                sock_dir=__opts__['sock_dir'],
                transport=__opts__['transport']
            )
            if __opts__.get('update_cachedir', False) is True:
                __utils__['cloud.delete_minion_cachedir'](vm_, __active_provider_name__.split(':')[0], __opts__)
    return ret
695367
def destroy_vm(self, vm, logger):
        

        self.power_off_before_destroy(logger, vm)

        logger.info(("Destroying VM {0}".format(vm.name)))

        task = vm.Destroy_Task()
        return self.task_waiter.wait_for_task(task=task, logger=logger, action_name="Destroy VM")
167059
def close(self):
        
        if not self.closed:
            _vv and IOLOG.debug('%r.close()', self)
            self.closed = True
            os.close(self.fd)
886438
async def terminate_vm(self, vm_id):
        
        if vm_id not in self._vms:
            raise DummyIaasVmNotFound()
        del self._vms[vm_id]
        return None