4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/vm_shepherd/vcloud/deployer.rb', line 4
def self.deploy_and_power_on_vapp(client:, ovf_dir:, vapp_config:, vdc_name:)
catalog = client.create_catalog(vapp_config.catalog)
catalog.upload_vapp_template(vdc_name, vapp_config.name, ovf_dir)
network_config = VCloudSdk::NetworkConfig.new(vapp_config.network, 'Network 1')
vapp = catalog.instantiate_vapp_template(vapp_config.name, vdc_name, vapp_config.name, nil, nil, network_config)
vm = vapp.find_vm_by_name(vapp_config.name)
vm.product_section_properties = vapp_config.build_properties
vapp.power_on
end
|