forked from ManageIQ/manageiq-providers-proxmox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfra_manager.rb
More file actions
23 lines (23 loc) · 1.28 KB
/
infra_manager.rb
File metadata and controls
23 lines (23 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class ManageIQ::Providers::Proxmox::Inventory::Persister::InfraManager < ManageIQ::Providers::Proxmox::Inventory::Persister
def initialize_inventory_collections
add_collection(infra, :clusters)
add_collection(infra, :hosts)
add_collection(infra, :host_hardwares)
add_collection(infra, :storages)
add_collection(infra, :host_storages)
add_collection(infra, :disks, :parent_inventory_collections => %i[vms_and_templates])
add_collection(infra, :guest_devices, :parent_inventory_collections => %i[vms_and_templates])
add_collection(infra, :hardwares, :parent_inventory_collections => %i[vms_and_templates])
add_collection(infra, :networks, :parent_inventory_collections => %i[vms_and_templates])
add_collection(infra, :operating_systems, :parent_inventory_collections => %i[vms_and_templates])
add_collection(infra, :vms_and_templates, {}, {:without_sti => true}) do |builder|
builder.vm_template_shared
# Proxmox doesn't have a good unique reference that isn't the VM ID which
# can be used to reconnect VMs from storage.
#
# Additionally Proxmox reuses VM IDs so a new VM will get the same ID
# as a previously deleted VM which would then be reconnected.
builder.add_properties(:custom_reconnect_block => nil)
end
end
end