Class: Chef::Knife::Cloud::VcenterVmCreate
- Inherits:
-
ServerCreateCommand
- Object
- ServerCreateCommand
- Chef::Knife::Cloud::VcenterVmCreate
- Includes:
- VcenterServiceOptions, ServerCreateOptions
- Defined in:
- lib/chef/knife/vcenter_vm_create.rb
Overview
Extends the ServerCreateCommand for specific vCenter
Instance Method Summary collapse
-
#before_exec_command ⇒ Object
Sets up the create options and puts them.
-
#validate_params! ⇒ Object
Validates the parameters, you need that unique name person!.
Methods included from VcenterServiceOptions
Instance Method Details
#before_exec_command ⇒ Object
Sets up the create options and puts them
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/chef/knife/vcenter_vm_create.rb', line 73 def before_exec_command super = { name: @name_args[0], type: "create", targethost: config[:targethost], folder: config[:folder], datastore: config[:datastore], resource_pool: config[:resource_pool], } puts end |
#validate_params! ⇒ Object
Validates the parameters, you need that unique name person!
61 62 63 64 65 66 67 68 69 |
# File 'lib/chef/knife/vcenter_vm_create.rb', line 61 def validate_params! super if @name_args.empty? ui.error("You must provide the name of the new machine") end check_for_missing_config_values!(:targethost, :datastore, :folder) end |