Sha256: 3171959f8fb14c416ce3adbe14c4752d851ef43f06003572b0948346f4fa99fa

Contents?: true

Size: 936 Bytes

Versions: 32

Compression:

Stored size: 936 Bytes

Contents

require 'vm_shepherd/retry_helper'

module VmShepherd
  module Vcloud
    class Deployer
      extend RetryHelper

      def self.deploy_and_power_on_vapp(client:, ovf_dir:, vapp_config:, vdc_name:)
        catalog = client.create_catalog(vapp_config.catalog)

        # upload template and instantiate vapp
        catalog.upload_vapp_template(vdc_name, vapp_config.name, ovf_dir)

        # instantiate template
        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)

        # reconfigure vm
        vm = retry_until(retry_limit: 10, retry_interval: 10) do
          vapp.vms.first
        end

        vm.product_section_properties = vapp_config.build_properties

        # power on vapp
        vapp.power_on
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
vm_shepherd-3.7.3 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.7.1 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.7.0 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.6.2 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.6.1 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.6.0 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.5.0 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.4.3 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.4.2 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.4.1 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.4.0 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.3.2 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.3.1 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.3.0 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.2.1 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.2.0 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.1.8 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.1.7 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.1.6 lib/vm_shepherd/vcloud/deployer.rb
vm_shepherd-3.1.5 lib/vm_shepherd/vcloud/deployer.rb