Skip to content

Commit 4085877

Browse files
committed
show the placement group
1 parent 35d008f commit 4085877

File tree

15 files changed

+601
-828
lines changed

15 files changed

+601
-828
lines changed

.gitignore

+4-12
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,8 @@
2626
!/.yarn/sdks
2727
!/.yarn/versions
2828

29-
/lib/tasks_private/terraform/provision/.terraform
30-
/lib/tasks_private/terraform/provision/terraform.*
31-
/lib/tasks_private/terraform/provision/*.log
32-
33-
/lib/tasks_private/terraform/placement_group/.terraform
34-
/lib/tasks_private/terraform/placement_group/terraform.*
35-
/lib/tasks_private/terraform/placement_group/*.log
36-
37-
/lib/tasks_private/terraform/snapshot/.terraform
38-
/lib/tasks_private/terraform/snapshot/terraform.*
39-
/lib/tasks_private/terraform/snapshot/*.log
40-
29+
/lib/tasks_private/terraform/**/terraform.*
30+
/lib/tasks_private/terraform/**/*.log
31+
/lib/tasks_private/terraform/**/.terraform
32+
/lib/tasks_private/terraform/**/.terraform*
4133
/lib/tasks_private/terraform/.byebug*

app/models/manageiq/providers/ibm_cloud/inventory/collector/power_virtual_servers.rb

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def placement_group(placement_group_id)
6565
nil
6666
end
6767

68+
def placement_groups
69+
@placement_groups ||= placement_groups_api.pcloud_placementgroups_getall(cloud_instance_id) || []
70+
end
71+
6872
def image_architecture(image_id)
6973
image = image(image_id)
7074
architecture = image&.specifications&.architecture

app/models/manageiq/providers/ibm_cloud/inventory/parser/power_virtual_servers.rb

+12
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def parse
3030
pvm_instances
3131
networks
3232
sshkeys
33+
placement_groups
3334
snapshots
3435
end
3536

@@ -255,6 +256,17 @@ def networks
255256
end
256257
end
257258

259+
def placement_groups
260+
collector.placement_groups.placement_groups.each do |sgrp|
261+
persister.placement_groups.build(
262+
:availability_zone => persister.availability_zones.lazy_find(persister.cloud_manager.uid_ems),
263+
:name => sgrp.name,
264+
:policy => sgrp.policy,
265+
:ems_ref => sgrp.id
266+
)
267+
end
268+
end
269+
258270
def sshkeys
259271
require "sshkey"
260272
collector.sshkeys.each do |tkey|

app/models/manageiq/providers/ibm_cloud/inventory/persister/power_virtual_servers.rb

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def initialize_cloud_inventory_collections
2323
add_cloud_collection(:hardwares)
2424
add_cloud_collection(:disks)
2525
add_cloud_collection(:operating_systems)
26+
add_cloud_collection(:placement_groups)
2627
add_cloud_collection(:auth_key_pairs)
2728
add_cloud_collection(:miq_templates)
2829
add_cloud_collection(:snapshots)

app/models/manageiq/providers/ibm_cloud/power_virtual_servers/cloud_manager.rb

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager < ManageI
55
require_nested :Flavor
66
require_nested :Refresher
77
require_nested :RefreshWorker
8+
require_nested :PlacementGroup
89
require_nested :Provision
910
require_nested :ProvisionWorkflow
1011
require_nested :Template
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager::PlacementGroup < ::PlacementGroup
2+
def self.raw_create_placement_group(ext_management_system, create_options)
3+
end
4+
5+
def raw_delete_placement_group
6+
end
7+
end

config/powervs_testsettings.yml

-10
This file was deleted.

content/miq_dialogs/miq_provision_ibm_powervs_vm_dialog.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
:data_type: :string
2424
:min_length: 8
2525
:max_length: 16
26+
:placement_group:
27+
:description: Placement Group
28+
:required: false
29+
:required_method: :validate_placement_group
30+
:display: :edit
31+
:default: ""
32+
:data_type: :string
2633
:pin_policy:
2734
:values:
2835
1: "none"

lib/tasks_private/terraform/powervs_testsettings.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ test:
33
- testname: placement_group
44
vm_name: miq-test-pg
55
key_pair_name: miq-pvs
6-
public_network_name: ca-ocp-e2c9-syd04-pub-net
6+
public_network_name: public-192_168_167_0-29-VLAN_2092
77
power_network_name: ocp-net
8-
image_name: rhel-84-07122021
8+
image_name: Linux-CentOS-8-3
99
sys_type: s922
1010
volume_name: rdr-miq-volume-1
1111
- testname: provision
1212
vm_name: miq-test-2
1313
key_pair_name: miq-pvs
14-
public_network_name: ca-ocp-e2c9-syd04-pub-net
14+
public_network_name: public-192_168_167_0-29-VLAN_2092
1515
power_network_name: ocp-net
16-
image_name: rhel-84-07122021
16+
image_name: Linux-CentOS-8-3
1717
sys_type: s922
1818
volume_name: rdr-miq-volume-2
1919
- testname: snapshot
2020
vm_name: miq-test-2
2121
key_pair_name: miq-pvs
22-
public_network_name: ca-ocp-e2c9-syd04-pub-net
22+
public_network_name: public-192_168_167_0-29-VLAN_2092
2323
power_network_name: ocp-net
24-
image_name: rhel-84-07122021
24+
image_name: Linux-CentOS-8-3
2525
sys_type: s922
2626
volume_name: rdr-miq-volume-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
version: 4
33
terraform_version: 0.13.5
4-
serial: 15
5-
lineage: f4167694-1f42-3334-126e-d2b33fc5c71b
4+
serial: 4
5+
lineage: e8b45237-aa46-81cb-2b62-457fdf8e1ff8
66
outputs:
77
progress:
88
value: 0
@@ -20,14 +20,14 @@ resources:
2020
attributes:
2121
architecture: ppc64
2222
hypervisor: phyp
23-
id: 589b5427-4693-4e94-a7bd-23a178ca745c
24-
image_type: import
23+
id: 1273f809-c1eb-4756-b233-6fa64f37b79e
24+
image_type: stock
2525
operatingsystem: rhel
26-
pi_cloud_instance_id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8
27-
pi_image_name: rhel-84-07122021
28-
size: 120
26+
pi_cloud_instance_id: 851f82c2-034c-4c32-9764-94262d245a50
27+
pi_image_name: Linux-CentOS-8-3
28+
size: 250
2929
state: active
30-
storage_pool: Tier3-Flash-2
30+
storage_pool: Tier3-Flash-1
3131
storage_type: tier3
3232
- mode: data
3333
type: ibm_pi_network
@@ -36,37 +36,37 @@ resources:
3636
instances:
3737
- schema_version: 0
3838
attributes:
39-
available_ip_count: 215
40-
cidr: 192.168.0.0/24
41-
gateway: 192.168.0.1
42-
id: b2f48036-4c01-4d01-b0eb-c510d2b03cc0
39+
available_ip_count: 253
40+
cidr: 192.168.24.0/24
41+
gateway: 192.168.24.1
42+
id: e25fd85e-30f5-447c-8096-0a6f5f9d4d8c
4343
jumbo: false
4444
name: ocp-net
45-
pi_cloud_instance_id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8
45+
pi_cloud_instance_id: 851f82c2-034c-4c32-9764-94262d245a50
4646
pi_network_name: ocp-net
4747
type: vlan
48-
used_ip_count: 37
49-
used_ip_percent: 14
50-
vlan_id: 452
48+
used_ip_count: 0
49+
used_ip_percent: 0
50+
vlan_id: 450
5151
- mode: data
5252
type: ibm_pi_network
5353
name: public_network
5454
provider: provider["registry.terraform.io/ibm-cloud/ibm"]
5555
instances:
5656
- schema_version: 0
5757
attributes:
58-
available_ip_count: 3
59-
cidr: 192.168.154.96/29
60-
gateway: 192.168.154.97
61-
id: e765c07c-83e9-4e6f-b76f-4f5e3512c493
62-
jumbo: false
63-
name: ca-ocp-e2c9-syd04-pub-net
64-
pi_cloud_instance_id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8
65-
pi_network_name: ca-ocp-e2c9-syd04-pub-net
58+
available_ip_count: 5
59+
cidr: 192.168.167.0/29
60+
gateway: 192.168.167.1
61+
id: 7a3f8b17-ab14-456a-85a7-8c150cb55c9a
62+
jumbo: true
63+
name: public-192_168_167_0-29-VLAN_2092
64+
pi_cloud_instance_id: 851f82c2-034c-4c32-9764-94262d245a50
65+
pi_network_name: public-192_168_167_0-29-VLAN_2092
6666
type: pub-vlan
67-
used_ip_count: 2
68-
used_ip_percent: 40
69-
vlan_id: 2008
67+
used_ip_count: 0
68+
used_ip_percent: 0
69+
vlan_id: 2092
7070
- mode: managed
7171
type: ibm_pi_instance
7272
name: pvminstance
@@ -75,47 +75,46 @@ resources:
7575
- schema_version: 0
7676
attributes:
7777
health_status: WARNING
78-
id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8/8fccb9fe-836a-43eb-a212-64e6fb871597
79-
instance_id: 8fccb9fe-836a-43eb-a212-64e6fb871597
80-
max_memory: 32
81-
max_processors: 8
82-
max_virtual_cores: 8
83-
min_memory: 2
84-
min_processors: 0.25
85-
min_virtual_cores: 1
86-
operating_system: Linux/Red Hat Enterprise Linux 4.18.0-305.7.1.el8_4.ppc68.4
87-
(Ootpa), 8.4 (Ootpa)
88-
os_type: rhel
78+
id: 851f82c2-034c-4c32-9764-94262d245a50/639cddab-c49f-46c5-bab4-575f7c5ab2d1
79+
instance_id: 639cddab-c49f-46c5-bab4-575f7c5ab2d1
80+
max_memory: 0
81+
max_processors: 0
82+
max_virtual_cores: 0
83+
min_memory: 0
84+
min_processors: 0
85+
min_virtual_cores: 0
86+
operating_system: ''
87+
os_type: ''
8988
pi_affinity_instance:
9089
pi_affinity_policy:
9190
pi_affinity_volume:
9291
pi_anti_affinity_instances:
9392
pi_anti_affinity_volumes:
94-
pi_cloud_instance_id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8
93+
pi_cloud_instance_id: 851f82c2-034c-4c32-9764-94262d245a50
9594
pi_health_status: WARNING
96-
pi_image_id: 589b5427-4693-4e94-a7bd-23a178ca745c
95+
pi_image_id: 69b66397-ede0-49e8-88b5-00b198225b4b
9796
pi_instance_name: miq-test-pg
9897
pi_key_pair_name: miq-pvs
9998
pi_license_repository_capacity: 0
100-
pi_memory: 4
99+
pi_memory: 0
101100
pi_migratable: false
102101
pi_network:
103-
- external_ip: 130.198.3.98
104-
ip_address: 192.168.154.98
105-
mac_address: fa:4e:20:74:fa:21
106-
network_id: e765c07c-83e9-4e6f-b76f-4f5e3512c493
107-
network_name: ca-ocp-e2c9-syd04-pub-net
108-
type: fixed
109102
- external_ip: ''
110-
ip_address: 192.168.0.109
111-
mac_address: fa:4e:20:74:fa:20
112-
network_id: b2f48036-4c01-4d01-b0eb-c510d2b03cc0
103+
ip_address: 192.168.24.159
104+
mac_address: fa:6f:76:25:b3:20
105+
network_id: e25fd85e-30f5-447c-8096-0a6f5f9d4d8c
113106
network_name: ocp-net
114107
type: fixed
108+
- external_ip: 169.54.122.4
109+
ip_address: 192.168.167.4
110+
mac_address: fa:6f:76:25:b3:21
111+
network_id: 7a3f8b17-ab14-456a-85a7-8c150cb55c9a
112+
network_name: public-192_168_167_0-29-VLAN_2092
113+
type: fixed
115114
pi_pin_policy: none
116-
pi_placement_group_id: 5b2e0b8a-d437-4813-8ac7-40a93bba9efc
117-
pi_proc_type: shared
118-
pi_processors: 1
115+
pi_placement_group_id: 6a5d1a12-27e1-42e8-9d94-405711dbb089
116+
pi_proc_type: ''
117+
pi_processors: 0
119118
pi_progress: 0
120119
pi_replicants: 1
121120
pi_replication_policy: none
@@ -129,7 +128,7 @@ resources:
129128
pi_user_data:
130129
pi_virtual_cores_assigned: 1
131130
pi_volume_ids:
132-
- 5ca30162-05f5-447b-9778-2403437fc44c
131+
- ae3a9f45-8fbe-40a4-8b58-f265bf013a06
133132
pin_policy: none
134133
status: ACTIVE
135134
timeouts:
@@ -147,12 +146,12 @@ resources:
147146
instances:
148147
- schema_version: 0
149148
attributes:
150-
id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8/5b2e0b8a-d437-4813-8ac7-40a93bba9efc
149+
id: 851f82c2-034c-4c32-9764-94262d245a50/6a5d1a12-27e1-42e8-9d94-405711dbb089
151150
members: []
152-
pi_cloud_instance_id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8
151+
pi_cloud_instance_id: 851f82c2-034c-4c32-9764-94262d245a50
153152
pi_placement_group_name: miq-placement-group
154153
pi_placement_group_policy: affinity
155-
placement_group_id: 5b2e0b8a-d437-4813-8ac7-40a93bba9efc
154+
placement_group_id: 6a5d1a12-27e1-42e8-9d94-405711dbb089
156155
timeouts:
157156
private: eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozNjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInVwZGF0ZSI6MzYwMDAwMDAwMDAwMH19
158157
- mode: managed
@@ -163,20 +162,20 @@ resources:
163162
- schema_version: 0
164163
attributes:
165164
delete_on_termination:
166-
id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8/5ca30162-05f5-447b-9778-2403437fc44c
165+
id: 851f82c2-034c-4c32-9764-94262d245a50/ae3a9f45-8fbe-40a4-8b58-f265bf013a06
167166
pi_affinity_instance:
168167
pi_affinity_policy:
169168
pi_affinity_volume:
170169
pi_anti_affinity_instances:
171170
pi_anti_affinity_volumes:
172-
pi_cloud_instance_id: 888f9bf2-ab12-48c4-9dc5-8da65de951a8
171+
pi_cloud_instance_id: 851f82c2-034c-4c32-9764-94262d245a50
173172
pi_volume_name: rdr-miq-volume-1
174173
pi_volume_pool: Tier3-Flash-2
175174
pi_volume_shareable: true
176175
pi_volume_size: 20
177176
pi_volume_type: tier3
178177
timeouts:
179-
volume_id: 5ca30162-05f5-447b-9778-2403437fc44c
178+
volume_id: ae3a9f45-8fbe-40a4-8b58-f265bf013a06
180179
volume_status: available
181-
wwn: 6005076810810256E8000000000041A0
182-
private: eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=
180+
wwn: 60050768108002DAC8000000000003E6
181+
private: eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=

0 commit comments

Comments
 (0)