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
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/chef/knife/vcenter_vm_create.rb', line 72 def before_exec_command super = { name: @name_args[0], type: "create", targethost: locate_config_value(:targethost), folder: locate_config_value(:folder), datastore: locate_config_value(:datastore), resource_pool: locate_config_value(:resource_pool), } puts end |
#validate_params! ⇒ Object
Validates the parameters, you need that unique name person!
60 61 62 63 64 65 66 67 68 |
# File 'lib/chef/knife/vcenter_vm_create.rb', line 60 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 |