Class: Chef::Knife::VcVmStop
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::VcVmStop
- Includes:
- VcCommon, VcVmCommon
- Defined in:
- lib/chef/knife/vm/vc_vm_stop.rb
Instance Method Summary collapse
Methods included from VcVmCommon
#get_vm, included, #sanitize_guest_name, #stop_if_running
Methods included from VcCommon
#connection, #deprecation_msg, #generate_key, #get_password, included, #locate_config_value, #locate_org_option, #notice_msg, #out_msg, #pretty_symbol, #sort_by_key, #store_config, #store_password, #wait_task
Instance Method Details
#run ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# 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 |