Module: Kitchen::Driver::Oci::Instance::ComputeLaunchDetails

Defined in:
lib/kitchen/driver/oci/instance/compute.rb

Overview

setter methods that populate the details of OCI::Core::Models::LaunchInstanceDetails

Instance Method Summary collapse

Instance Method Details

#agent_configObject



56
57
58
59
60
61
62
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 56

def agent_config
  launch_details.agent_config = OCI::Core::Models::LaunchInstanceAgentConfigDetails.new(
    are_all_plugins_disabled: config[:all_plugins_disabled],
    is_management_disabled: config[:management_disabled],
    is_monitoring_disabled: config[:monitoring_disabled]
  )
end

#capacity_reservationObject



52
53
54
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 52

def capacity_reservation
  launch_details.capacity_reservation_id = config[:capacity_reservation_id]
end

#hostname_display_nameObject



25
26
27
28
29
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 25

def hostname_display_name
  display_name = config[:display_name] || hostname
  launch_details.display_name = display_name
  launch_details.create_vnic_details = create_vnic_details(display_name)
end

#instance_metadataObject



83
84
85
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 83

def 
  launch_details. = 
end

#instance_source_via_boot_volumeObject



74
75
76
77
78
79
80
81
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 74

def instance_source_via_boot_volume
  return unless config[:boot_volume_id]

  launch_details.source_details = OCI::Core::Models::InstanceSourceViaBootVolumeDetails.new(
    boot_volume_id: clone_boot_volume,
    sourceType: "bootVolume"
  )
end

#instance_source_via_imageObject



64
65
66
67
68
69
70
71
72
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 64

def instance_source_via_image
  return if config[:boot_volume_id]

  launch_details.source_details = OCI::Core::Models::InstanceSourceViaImageDetails.new(
    sourceType: "image",
    imageId: image_id,
    bootVolumeSizeInGBs: config[:boot_volume_size_in_gbs]
  )
end

#preemptible_instance_configObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 31

def preemptible_instance_config
  return unless config[:preemptible_instance]

  launch_details.preemptible_instance_config = OCI::Core::Models::PreemptibleInstanceConfigDetails.new(
    preemption_action:
      OCI::Core::Models::TerminatePreemptionAction.new(
        type: "TERMINATE", preserve_boot_volume: true
      )
  )
end

#shape_configObject



42
43
44
45
46
47
48
49
50
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 42

def shape_config
  return if config[:shape_config].empty?

  launch_details.shape_config = OCI::Core::Models::LaunchInstanceShapeConfigDetails.new(
    ocpus: config[:shape_config][:ocpus],
    memory_in_gbs: config[:shape_config][:memory_in_gbs],
    baseline_ocpu_utilization: config[:shape_config][:baseline_ocpu_utilization] || "BASELINE_1_1"
  )
end