class Chef::Knife::VcVmStop

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/vm/vc_vm_stop.rb, line 27
def run
  $stdout.sync = true

  vm_arg = @name_args.shift

  connection.login
  vm = get_vm(vm_arg)

  task_id = connection.poweroff_vm vm[:id]

  ui.msg "VM stop..."
  wait_task(connection, task_id)

  connection.logout
end