Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def sshkeys
@sshkeys ||= tenants_api.pcloud_tenants_get(pcloud_tenant_id).ssh_keys
end

def system_pools
@system_pools ||= system_pools_api.pcloud_systempools_get(cloud_instance_id)
def datacenter
@datacenter ||= datacenters_api.v1_datacenters_get(pcloud_location)
end

def storage_types
Expand Down Expand Up @@ -163,6 +163,10 @@ def pcloud_tenant_id
cloud_manager.pcloud_tenant_id(connection)
end

def pcloud_location
cloud_manager.pcloud_location(connection)
end

def placement_groups_api
@placement_groups_api ||= IbmCloudPower::PCloudPlacementGroupsApi.new(connection)
end
Expand All @@ -187,8 +191,8 @@ def storage_capacity_api
@storage_capacity_api ||= IbmCloudPower::PCloudStorageCapacityApi.new(connection)
end

def system_pools_api
@system_pools_api ||= IbmCloudPower::PCloudSystemPoolsApi.new(connection)
def datacenters_api
@datacenters_api ||= IbmCloudPower::DatacentersApi.new(connection)
end

def tenants_api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ def sshkeys
end

def flavors
collector.system_pools.each_value do |value|
collector.datacenter.capabilities_details.supported_systems.general.each do |system_type|
persister.flavors.build(
:type => "ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::SystemType",
:ems_ref => value.type,
:name => value.type
:ems_ref => system_type,
:name => system_type
)
end
if collector.cloud_instance.capabilities.include?('sap')
Expand Down
2 changes: 1 addition & 1 deletion lib/manageiq/providers/ibm_cloud/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module IbmCloud
class Engine < ::Rails::Engine
isolate_namespace ManageIQ::Providers::IbmCloud

config.autoload_paths << root.join('lib').to_s
config.autoload_paths << root.join('lib')

def self.vmdb_plugin?
true
Expand Down
13 changes: 7 additions & 6 deletions lib/tasks_private/power_virtual_servers.rake
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace :vcr do
:instances => [
IbmCloudPower::PVMInstanceCreate.new(
"server_name" => "test-instance-aix-s922-shared-tier1",
"image_id" => "7300-00-01",
"image_id" => "7300-03-00",
"sys_type" => "s922",
"proc_type" => "shared",
"storage_type" => "tier1",
Expand All @@ -115,7 +115,7 @@ namespace :vcr do
),
IbmCloudPower::PVMInstanceCreate.new(
"server_name" => "test-instance-ibmi-s922-capped-tier1",
"image_id" => "IBMi-75-02-2984-1",
"image_id" => "IBMi-75-05-2984-1",
"sys_type" => "s922",
"proc_type" => "capped",
"storage_type" => "tier1",
Expand All @@ -132,7 +132,7 @@ namespace :vcr do
),
IbmCloudPower::PVMInstanceCreate.new(
"server_name" => "test-instance-centos-e980-dedicated-tier3",
"image_id" => "CentOS-Stream-8",
"image_id" => "CentOS-Stream-9",
"sys_type" => "e980",
"proc_type" => "dedicated",
"storage_type" => "tier3",
Expand All @@ -148,7 +148,7 @@ namespace :vcr do
),
IbmCloudPower::PVMInstanceCreate.new(
"server_name" => "test-instance-rhel-s922-shared-tier3",
"image_id" => "RHEL8-SP6",
"image_id" => "RHEL9-SP4-BYOL",
"sys_type" => "s922",
"proc_type" => "shared",
"storage_type" => "tier3",
Expand All @@ -165,7 +165,7 @@ namespace :vcr do
),
IbmCloudPower::PVMInstanceCreate.new(
"server_name" => "test-instance-sles-s922-shared-tier3",
"image_id" => "SLES15-SP4",
"image_id" => "SLES15-SP6-BYOL",
"sys_type" => "s922",
"proc_type" => "shared",
"storage_type" => "tier3",
Expand All @@ -184,7 +184,7 @@ namespace :vcr do
),
IbmCloudPower::PVMInstanceCreate.new(
"server_name" => "test-instance-rhcos-s922-shared-tier3",
"image_id" => "rhcos-4.8",
"image_id" => "rhcos-416",
"sys_type" => "s922",
"proc_type" => "shared",
"storage_type" => "tier3",
Expand Down Expand Up @@ -426,6 +426,7 @@ namespace :vcr do
instance
)[0]

sleep(60)
pvm_instance_id = created_instance.pvm_instance_id
until created_instance.status == "ACTIVE"
created_instance = pvm_instances_api.pcloud_pvminstances_get(
Expand Down
2 changes: 1 addition & 1 deletion manageiq-providers-ibm_cloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "ibm_cloud_iam", "~> 1.0"
spec.add_dependency "ibm_cloud_power", "~> 2.1"
spec.add_dependency "ibm_cloud_power", "~> 3.0"
spec.add_dependency "ibm_cloud_resource_controller", "~> 2.0", ">= 2.0.2"
spec.add_dependency "ibm-cloud-sdk", "~> 0.1"
spec.add_dependency "ibm_cloud_activity_tracker", "~> 0.1", ">= 0.1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def assert_table_counts
expect(CloudVolume.count).to eq(10)
expect(CloudNetwork.count).to eq(4)
expect(CloudSubnet.count).to eq(4)
expect(CloudSubnetNetworkPort.count).to eq(8)
expect(Flavor.count).to eq(58)
expect(CloudSubnetNetworkPort.count).to eq(12)
expect(Flavor.count).to eq(130)
expect(MiqTemplate.count).to eq(6)
expect(ManageIQ::Providers::CloudManager::AuthKeyPair.count).to be > 1
expect(NetworkPort.count).to eq(8)
Expand All @@ -168,7 +168,7 @@ def assert_ems_counts

def assert_cloud_manager
expect(ems).to have_attributes(
:provider_region => "mon01"
:provider_region => "us-east10"
)
end

Expand Down Expand Up @@ -221,7 +221,7 @@ def assert_specific_vm
)

expect(vm.advanced_settings.find { |setting| setting['name'] == 'pin_policy' }).to have_attributes(
:value => "none"
:value => "soft"
)

expect(vm.snapshots.first).to have_attributes(
Expand All @@ -238,7 +238,7 @@ def assert_specific_vm
end

def assert_specific_template
template_name = "7300-00-01"
template_name = "7300-03-00"
template = ems.miq_templates.find_by(:name => template_name)
expect(template).to have_attributes(
:name => template_name,
Expand Down Expand Up @@ -292,7 +292,7 @@ def assert_specific_network_port
:device_type => "VmOrTemplate"
)

expect(network_port.cloud_subnets.count).to eq(1)
expect(network_port.cloud_subnets.count).to eq(2)
end

def assert_specific_cloud_volume
Expand Down
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def replace_ssh_keys(response)
# Replace the contents of the token before writing to file.
def replace_token_contents(interaction)
data = JSON.parse(interaction.response.body, :symbolize_names => true)
data.merge!({:refresh_token => 'REFRESH_TOKEN', :ims_user_id => '22222', :expiration => Date.new(2100, 1, 1).to_time.to_i})
data.merge!({:access_token => 'ACCESS_TOKEN', :refresh_token => 'REFRESH_TOKEN', :ims_user_id => '22222', :expiration => Date.new(2100, 1, 1).to_time.to_i})
interaction.response.body = data.to_json.force_encoding('ASCII-8BIT')

transient_headers = %w[].freeze
Expand Down Expand Up @@ -65,8 +65,8 @@ def header_sanitizer(response_header, transient_headers)
config.configure_rspec_metadata! # Auto-detects the cassette name based on the example's full description

config.before_record do |i|
replace_token_contents(i) if i.request.uri == "https://iam.cloud.ibm.com/identity/token"
vpc_sanitizer(i) if i.request.uri.match?('iaas.cloud.ibm') || i.request.uri.match?('tags.global-search-tagging')
replace_token_contents(i) if i.request.uri.start_with?("https://iam.cloud.ibm.com/identity/token")
vpc_sanitizer(i) if i.request.uri.match?('cloud.ibm') || i.request.uri.match?('tags.global-search-tagging')
end

VcrSecrets.define_all_cassette_placeholders(config, :ibm_cloud_power)
Expand Down

Large diffs are not rendered by default.

Loading