class Fission::Action::VM::Deleter

def delete

If there is an error, an unsuccessful Response will be returned.
If successful, the Response's data attribute will be nil.
Returns a Response with the result.

@deleter.delete

Examples

deleted. This leads to 'missing' VMs in the Fusion GUI.
been observed that Fusion will recreate the plist data which is
If the Fusion GUI is running this method should succeed, but it's
It's highly recommended to delete VMs without the Fusion GUI running.
attempts to remove the relevant entries from the Fusion plist file.
this method is called. This essentially deletes the VM directory and
deleting VMs, this is a best effort. The VM must not be running when
it. As there are a number issues with the Fusion command line tool for
Public: Deletes a VM. The VM must not be running in order to delete
def delete
  unless @vm.exists?
    return Response.new :code => 1, :message => 'VM does not exist'
  end
  running_response = @vm.running?
  return running_response unless running_response.successful?
  if running_response.data
    message = 'The VM must not be running in order to delete it.'
    return Response.new :code => 1, :message => message
  end
  FileUtils.rm_rf @vm.path
  Metadata.delete_vm_info @vm.path
  Response.new :code => 0
end

def initialize(vm)

Returns a new VMDeleter object

Fission::Action::VMDeleter.new @my_vm

Examples:

vm - An instance of VM

Internal: Creates a new VMDeleter object. This accepts a VM object.
def initialize(vm)
  @vm = vm
end

def vmrun_cmd

Fission.config['vmrun_cmd'].
Returns a String for the configured value of

# => "/foo/bar/vmrun -T fusion"
@deleter.vmrun_cmd

Examples

Internal: Helper for getting the configured vmrun_cmd value.
def vmrun_cmd
  Fission.config['vmrun_cmd']
end