diff --git a/CHANGELOG.md b/CHANGELOG.md
index 051cd7de..116fc33c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,53 +1,251 @@
-## Version 4.12.2
+## Version 4.13.0
+
+### Deprecated
+| Компонент | Тип | Подробности |
+| --- | --- | --- |
+| `decort_account_audits_list`
`decort_kvmvm_audits`
`decort_kvmvm_get_audits`
`decort_rg_audits`
`decort_vins_audits` | Datasource | Будут удалены в `v4.14.0`. Используйте `decort_audit_list` |
+| `decort_account_consumed_units_by_type`
`decort_account_reserved_units` | Datasource | Будут удалены в `v4.14.0` |
+| `decort_cb_account_audits_list`
`decort_cb_kvmvm_audits`
`decort_cb_kvmvm_get_audits`
`decort_cb_rg_audits`
`decort_cb_vins_audits` | Datasource | Будут удалены в `v4.14.0`. Используйте `decort_cb_audit_list` |
+| `decort_cb_kvmvm_get_log`
`decort_cb_grid_list_emails`
`decort_cb_user_get_audit` | Datasource | Будут удалены в `v4.14.0` |
### Добавлено
-#### SDN logicalports
+#### disks
| Идентификатор
задачи | Описание |
| --- | --- |
-| BATF-1363 | Вычисляемые поля `id`, `logical_port_id` и `assigned_at` в блоке `logical_port_addresses` в resource `decort_sdn_logical_port` в sdn/logicalports |
+| BATF-1314 | Вычисляемое поле `computes_read_only` в resource `decort_disk` в cloudapi/disks |
+| BATF-1314 | Вычисляемое поле `computes_read_only` в datasources `decort_disk`, `decort_disk_list` и `decort_disk_list_deleted` в cloudapi/disks |
+| BATF-1314 | Вычисляемое поле `computes_read_only` в resource `decort_cb_disk` в cloudbroker/disks |
+| BATF-1314 | Вычисляемое поле `computes_read_only` в datasources `decort_cb_disk`, `decort_cb_disk_list` и `decort_cb_disk_list_deleted` в cloudbroker/disks |
+| BATF-1334 | Вычисляемое поле `pool_name` в блоке `snapshots` в datasource `decort_disk` в cloudapi/disks |
+| BATF-1334 | Вычисляемое поле `pool_name` в блоке `snapshots` в datasource `decort_cb_disk` в cloudbroker/disks |
+| BATF-1356 | Вычисляемое поле `pool_name` в блоке `snapshots` в resource `decort_disk` в cloudapi/disks |
+| BATF-1356 | Вычисляемое поле `pool_name` в блоке `snapshots` в datasources `decort_disk_list`, `decort_disk_list_deleted`, `decort_disk_list_unattached` и `decort_disk_replication` в cloudapi/disks |
+| BATF-1356 | Вычисляемое поле `pool_name` в блоке `snapshots` в resource `decort_cb_disk` в cloudbroker/disks |
+| BATF-1356 | Вычисляемое поле `pool_name` в блоке `snapshots` в datasources `decort_cb_disk_list`, `decort_cb_disk_list_deleted` и `decort_cb_disk_replication` в cloudbroker/disks |
#### extnet
| Идентификатор
задачи | Описание |
| --- | --- |
-| BATF-1375 | Вычисляемые поля `sec_vnfdev_id` и `pre_reservations` в resource `decort_cb_extnet` в cloudbroker/extnet |
+| BATF-1302 | Вычисляемое поле `free_ips` в datasource `decort_extnet_list` в cloudapi/extnet |
+| BATF-1375 | Вычисляемые поля `pre_reservations` и `sec_vnfdev_id` в resource `decort_cb_extnet` в cloudbroker/extnet |
+| BATF-1375 | Вычисляемое поле `desc` в блоке `reservations` в resource `decort_cb_extnet` в cloudbroker/extnet |
+
+#### grid
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1311 | Вычисляемые поля `cpu_allocation_ratio_vm`, `cpu_allocation_ratio`, `custom_backup_path`, `interface_generation_scheme`, `mac_address_prefix`, `node_self_stop_timer_uptime_monitor` и `node_self_stop_uptime_monitor` в datasource `decort_cb_grid_get_settings` в cloudbroker/grid |
+| BATF-1311 | Вычисляемое поле `zero_access_enabled` в datasource `decort_cb_grid` в cloudbroker/grid |
+| BATF-1311 | Вычисляемое поле `policies` в datasource `decort_cb_grid_get_consumption` в cloudbroker/grid |
+| BATF-1333 | Вычисляемые поля `reserved_cpu` и `reserved_ram` в datasources `decort_cb_grid` и `decort_cb_grid_list` в cloudbroker/grid |
+| BATF-1333 | Вычисляемое поле `policies` в блоках `current` и `reserved` в datasource `decort_cb_grid_list` в cloudbroker/grid |
+| BATF-1333 | Вычисляемое поле `bro_enabled` в блоке `items` в datasource `decort_cb_grid_list` в cloudbroker/grid |
+| BATF-1424 | Возможность задать поле `vnfdev_start` при создании resource `decort_cb_vins` в cloudbroker/vins |
#### kvmvm
| Идентификатор
задачи | Описание |
| --- | --- |
-| BATF-1375 | Вычисляемое поле `user_data` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1323 | Вычисляемое поле `memory_dump_image` в блоке `snap_sets` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1323 | Вычисляемое поле `memory_dump_image` в блоке `snap_sets` в resource `decort_kvmvm` в cloudapi/kvmvm |
+| BATF-1323 | Вычисляемое поле `memory_dump_image` в блоке `snap_sets` в datasources `decort_cb_kvmvm`, `decort_cb_kvmvm_list` и `decort_cb_kvmvm_list_deleted` в cloudbroker/kvmvm |
+| BATF-1323 | Вычисляемое поле `memory_dump_image` в блоке `snap_sets` в datasources `decort_kvmvm`, `decort_kvmvm_list` и `decort_kvmvm_list_deleted` в cloudapi/kvmvm |
+| BATF-1313 | Опциональное поле `read_only` в блоке `disks` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1313 | Опциональное поле `read_only` в блоке `disks` в resource `decort_kvmvm` в cloudapi/kvmvm |
+| BATF-1313 | Вычисляемое поле `read_only` в блоке `disks` в datasources `decort_cb_kvmvm`, `decort_cb_kvmvm_list` и `decort_cb_kvmvm_list_deleted` в cloudbroker/kvmvm |
+| BATF-1313 | Вычисляемое поле `read_only` в блоке `disks` в datasources `decort_kvmvm`, `decort_kvmvm_list` и `decort_kvmvm_list_deleted` в cloudapi/kvmvm |
+| BATF-1303 | Опциональное поле `clock` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1303 | Опциональное поле `clock` в resource `decort_kvmvm` в cloudapi/kvmvm |
+| BATF-1303 | Вычисляемое поле `clock` в datasources `decort_cb_kvmvm`, `decort_cb_kvmvm_list` и `decort_cb_kvmvm_list_deleted` в cloudbroker/kvmvm |
+| BATF-1303 | Вычисляемое поле `clock` в datasources `decort_kvmvm`, `decort_kvmvm_list` и `decort_kvmvm_list_deleted` в cloudapi/kvmvm |
+| BATF-1297 | Datasource `decort_cb_kvmvm_cpu_alignment_profile` в cloudbroker/kvmvm |
+| BATF-1297 | Datasource `decort_kvmvm_cpu_alignment_profile` в cloudapi/kvmvm |
+| BATF-1297 | Опциональное поле `cpu_alignment_profile` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1297 | Опциональное поле `cpu_alignment_profile` в resource `decort_kvmvm` в cloudapi/kvmvm |
+| BATF-1297 | Вычисляемое поле `cpu_alignment_profiles` в datasources `decort_cb_kvmvm`, `decort_cb_kvmvm_list` и `decort_cb_kvmvm_list_deleted` в cloudbroker/kvmvm |
+| BATF-1297 | Вычисляемое поле `cpu_alignment_profiles` в datasources `decort_kvmvm`, `decort_kvmvm_list` и `decort_kvmvm_list_deleted` в cloudapi/kvmvm |
+| BATF-1335 | Вычисляемое поле `pool_name` в блоке `snapshots` в datasource `decort_kvmvm` в cloudapi/kvmvm и в datasource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1332 | Вычисляемое поле `node_id` в datasources `decort_kvmvm` и `decort_kvmvm_list` в cloudapi/kvmvm |
+| BATF-1326 | Опциональное поле `enable_default_gateway` в блоке `network` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1326 | Опциональное поле `enable_default_gateway` в блоке `network` в resource `decort_kvmvm` в cloudapi/kvmvm |
+| BATF-1326 | Вычисляемое поле `enable_default_gateway` в блоке `interfaces` в datasources `decort_cb_kvmvm`, `decort_cb_kvmvm_list` и `decort_cb_kvmvm_list_deleted` и resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1326 | Вычисляемое поле `enable_default_gateway` в блоке `interfaces` в datasources `decort_kvmvm`, `decort_kvmvm_list` и `decort_kvmvm_list_deleted` и resource `decort_kvmvm` в cloudapi/kvmvm |
+| BATF-1342 | Вычисляемое поле `resized_online` в resource `decort_kvmvm` в cloudapi/kvmvm и в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1342 | Вычисляемое поле `resized_online` в datasources `decort_kvmvm`, `decort_kvmvm_list` и `decort_kvmvm_list_deleted` в cloudapi/kvmvm и в datasources `decort_cb_kvmvm`, `decort_cb_kvmvm_list` и `decort_cb_kvmvm_list_deleted` в cloudbroker/kvmvm |
+| BATF-1343 | Вычисляемые поля `completed`, `cpu_set`, `daemon_addr`, `domain_name`, `domain_uuid`, `elapsed_time`, `gid`, `guid`, `migration_id`, `interfaces`, `log`, `new_disk_xmls`, `new_disks`, `old_disks`, `pid`, `source_node_id`, `source_numa_node_id`, `source_reserved_node_cpus`, `source_url`, `status`, `target_shadow_compute`, `target_node_id`, `target_url` и `vmlog_dir` в datasource `decort_cb_kvmvm_migrate_storage_info` в cloudbroker/kvmvm |
+#### node
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1306 | Вычисляемое поле `pci_devices` в datasource `decort_cb_node_list` в cloudbroker/node |
+| BATF-1294 | Вычисляемые поля `one_g_free`, `one_g_reserved`, `one_g_available`, `one_g_used`, `one_g_dpdk_reserved`, `two_m_free`, `two_m_reserved`, `two_m_available` и `two_m_used` в блоке `memory` в datasources `decort_cb_node` и `decort_cb_node_list` в cloudbroker/node |
+| BATF-1305 | Datasources `decort_cb_node_network_info` и `decort_cb_node_pci_devices` в cloudbroker/node |
+| BATF-1330 | Вычисляемые поля `reserved_cpu` и `reserved_ram` в datasources `decort_cb_node` и `decort_cb_node_list` в cloudbroker/node |
+| BATF-1336 | Вычисляемое поле `machine_id` в datasource `decort_cb_node_list` в cloudbroker/node |
+| BATF-1364 | Вычисляемое поле `ovs_dpdk_cores` в datasources `decort_cb_node` и `decort_cb_node_list` в cloudbroker/node |
+
+#### rg
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1337 | Опциональное поле `enable_default_gateway` в resource `decort_resgroup` в cloudapi/resgroup и в resource `decort_cb_rg` в cloudbroker/resgroup |
+| BATF-1309 | Вычисляемое поле `email` в блоке `acl` в datasources `decort_cb_rg_list` и `decort_cb_rg_list_deleted` в cloudbroker/rg |
+
+#### sep
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1318 | Вычисляемые поля `entry_count` и `items` в datasource `decort_cb_sep_consumption` в cloudbroker/sep |
+
+#### vins
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1327 | Опциональное поле `enable_default_gateway` в resource `decort_cb_vins` в cloudbroker/vins |
+| BATF-1327 | Вычисляемое поле `enable_default_gateway` в datasources `decort_cb_vins`, `decort_cb_vins_list` и `decort_cb_vins_list_deleted` в cloudbroker/vins |
+| BATF-1327 | Опциональное поле `enable_default_gateway` в resource `decort_vins` в cloudapi/vins |
+| BATF-1327 | Вычисляемое поле `enable_default_gateway` в datasource `decort_vins` в cloudapi/vins |
+
+#### zone
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1295 | Опциональное поле `hypervisor_similarity_in_percentage` в resource `decort_cb_zone` в cloudbroker/zone |
+| BATF-1295 | Вычисляемое поле `cpu_alignment_profiles` в resource `decort_cb_zone` в cloudbroker/zone |
+| BATF-1295 | Datasources `decort_cb_zone_cpu_alignment_profile`, `decort_cb_zone_cpu_alignment_profile_list` и `decort_cb_zone_cpu_alignment_profile_test` в cloudbroker/zone |
+| BATF-1296 | Вычисляемое поле `cpu_alignment_profiles` в datasources `decort_zone` и `decort_zone_list` в cloudapi/zone |
+| BATF-1296 | Вычисляемое поле `cpu_alignment_profiles` в datasources `decort_cb_zone` и `decort_cb_zone_list` и в resource `decort_cb_zone` в cloudbroker/zone |
+| BATF-1328 | Опциональные поля `reserved_cpu` и `reserved_ram` в resource `decort_cb_zone` в cloudbroker/zone |
+| BATF-1329 | Вычисляемые поля `reserved_cpu` и `reserved_ram` в datasources `decort_cb_zone` и `decort_cb_zone_list` в cloudbroker/zone |
+| BATF-1329 | Вычисляемые поля `reserved_cpu` и `reserved_ram` в datasources `decort_zone` и `decort_zone_list` в cloudapi/zone |
-### Изменено
#### SDN logicalports
| Идентификатор
задачи | Описание |
| --- | --- |
-| BATF-1363 | Тип поля `logical_port_addresses` с `list` на `set` в resource `decort_sdn_logical_port` в sdn/logicalports |
-| BATF-1363 | Тип поля `unique_identifier` с опционального на опционально-вычисляемое в resource `decort_sdn_logical_port` в sdn/logicalports |
-| BATF-1363 | Тип поля `is_primary` в блоке `logical_port_addresses` с обязательного на опциональное в resource `decort_sdn_logical_port` в sdn/logicalports |
+| BATF-1315 | Вычисляемое поле `exclude_firewall` в resource `decort_sdn_logical_port` и datasources `decort_sdn_logical_port`, `decort_sdn_logical_port_get_by_unique_identifier` и `decort_sdn_logical_port_list` в sdn/logicalports |
+| BATF-1363 | Вычисляемые поля `id`, `logical_port_id` и `assigned_at` в блоке `logical_port_addresses` в resource `decort_sdn_logical_port` в sdn/logicalports |
+
+#### SDN netobjgroups
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1308 | Опциональное поле `type` в datasource `decort_sdn_network_object_group_list` в sdn/netobjgroups |
+| BATF-1308 | Вычисляемые поля `Comment`, `DisplayName`, `Enabled`, `ExternalNetworkID`, `IPv4` и `MAC` в datasources `decort_sdn_network_object_group` и `decort_sdn_network_object_group_list` в sdn/netobjgroups |
+| BATF-1308 | Вычисляемые поля `Comment`, `DisplayName`, `Enabled`, `ExternalNetworkID`, `IPv4` и `MAC` в resource `decort_sdn_network_object_group` в sdn/netobjgroups |
+
+
+### Изменено
+
+#### account
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1310 | Тип поля `cpu_allocation_ratio` с `float` на `int` в datasource и resource `decort_account` в cloudapi/account |
+| BATF-1310 | Тип поля `cpu_allocation_ratio` с `float` на `int` в datasources `decort_cb_account`, `decort_cb_account_list` и `decort_cb_account_list_deleted` и resource `decort_cb_account` в cloudbroker/account |
+
+#### disks
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1300 | Тип опционального поля `blk_discard` с `bool` на `string` и переименование в `discard` в resource `decort_cb_disk` в cloudbroker/disks |
+| BATF-1300 | Тип вычисляемого поля `blk_discard` с `bool` на `string` и переименование в `discard` в datasources `decort_cb_disk`, `decort_cb_disk_list`, `decort_cb_disk_list_unattached` и `decort_cb_disk_list_deleted` в cloudbroker/disks |
+| BATF-1300 | Тип вычисляемого поля `blk_discard` с `bool` на `string` и переименование в `discard` в resource `decort_disk` и datasources `decort_disk`, `decort_disk_list`, `decort_disk_list_unattached` и `decort_disk_list_deleted` в cloudapi/disks |
+
+#### image
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1299 | Тип поля `account_id` c опционального на обязательный в resource `decort_image_virtual` в cloudapi/image |
+| BATF-1304 | Тип опционального поля `type_image` с `string` на `[]string` в datasource `decort_image_list` в cloudapi/image |
+| BATF-1304 | Тип опционального поля `type_image` с `string` на `[]string` в datasource `decort_cb_image_list` в cloudbroker/image |
+| BATF-1304 | Переименование вычисляемого поля `type` в `type_image` в блоке `items` в datasource `decort_image_list` в cloudapi/image |
+
+#### kvmvm
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1300 | Тип вычисляемого поля `blk_discard` с `bool` на `string` и переименование в `discard` в блоке `disks` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1300 | Тип опционального поля `blk_discard` с `bool` на `string` и переименование в `discard` в блоке `disks` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1300 | Тип опционального поля `boot_disk_blk_discard` с `bool` на `string` и переименование в `boot_disk_discard` в resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1300 | Тип вычисляемого поля `blk_discard` с `bool` на `string` и переименование в `discard` в блоке `disks` в datasource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+| BATF-1300 | Тип вычисляемого поля `blk_discard` с `bool` на `string` и переименование в `discard` в блоке `disks` в resource `decort_kvmvm` и datasource `decort_kvmvm` в cloudapi/kvmvm |
#### k8ci
| Идентификатор
задачи | Описание |
| --- | --- |
| BATF-1376 | Опциональное поле `enabled` получило значение по умолчанию `true` в resource `decort_cb_k8ci` в cloudbroker/k8ci |
+#### node
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1312 | Тип вычисляемых полей `cpu_allocation_ratio` и `mem_allocation_ratio` с `float` на `int` в datasources `decort_cb_node` и `decort_cb_node_list` в cloudbroker/node |
+| BATF-1312 | Тип вычисляемого поля `vcpu` с `float` на `int` в блоке `free` в datasource `decort_cb_node` в cloudbroker/node |
+
+#### rg
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1309 | Тип поля `cpu_allocation_ratio` с `float` на `int` в datasources `decort_resgroup`, `decort_rg_list`, `decort_rg_list_deleted` и resource `decort_resgroup` в cloudapi/rg |
+| BATF-1309 | Тип поля `cpu_allocation_ratio` с `float` на `int` в datasources `decort_cb_rg`, `decort_cb_rg_list`, `decort_cb_rg_list_deleted` и resource `decort_cb_rg` в cloudbroker/rg |
+
+#### sep
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1318 | Тип поля `sep_id` c обязательного на опциональный в datasource `decort_cb_sep_consumption` в cloudbroker/sep |
+
#### storage policy
| Идентификатор
задачи | Описание |
| --- | --- |
| BATF-1373 | Тип поля `limit_iops` с опционального на опционально-вычисляемое в resource `decort_cb_storage_policy` в cloudbroker/stpolicy |
-
-### Исправлено
+#### user
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1293 | Тип поля `password` с опционального на обязательный в resource `decort_cb_user` в cloudbroker/user |
#### SDN logicalports
| Идентификатор
задачи | Описание |
| --- | --- |
-| BATF-1363 | Баг с полем `labels` при обновлении resource `decort_sdn_logical_port` в sdn/logicalports |
-| BATF-1363 | Каскадное изменение адресов `logical_port_addresses` при редактировании списка блоков адресов в resource `decort_sdn_logical_port` в sdn/logicalports |
+| BATF-1363 | Тип поля `logical_port_addresses` с `list` на `set` в resource `decort_sdn_logical_port` в sdn/logicalports |
+| BATF-1363 | Тип поля `unique_identifier` с опционального на опционально-вычисляемый в resource `decort_sdn_logical_port` в sdn/logicalports |
+| BATF-1363 | Тип поля `is_primary` в блоке `logical_port_addresses` с обязательного на опциональный в resource `decort_sdn_logical_port` в sdn/logicalports |
+
+
+### Исправлено
#### extnet
| Идентификатор
задачи | Описание |
| --- | --- |
-| BATF-1375 | Баги с полями `shared_with`, `vnfdev_ip`, `default_qos`, `default_qos`, `highly_available`, `mtu` и `sec_vnfdev_id` при создании resource `decort_cb_extnet` в cloudbroker/extnet |
+| BATF-1375 | Баг с обновлением поля `enable_secgroups` в resource `decort_cb_extnet` в cloudbroker/extnet |
+| BATF-1375 | Баги с опциональными полями `shared_with`, `sec_vnfdev_id`, `ntp`, `default_qos`, `enable`, `highly_available` и `vnfdev_ip` при создании resource `decort_cb_extnet` в cloudbroker/extnet |
+#### kvmvm
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1375 | Баг с полем `user_data` при чтении resource `decort_cb_kvmvm` в cloudbroker/kvmvm |
+
+#### SDN logicalports
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1360 | Баг с полем `adapter_mac` при обновлении resource `decort_sdn_logical_port` в sdn/logicalports |
+| BATF-1360 | Баг с полем `labels` при обновлении resource `decort_sdn_logical_port` в sdn/logicalports |
+| BATF-1360 | Каскадное изменение адресов `logical_port_addresses` при редактировании списка блоков адресов в resource `decort_sdn_logical_port` в sdn/logicalports |
+
+
+### Удалено
+
+#### grid
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1311 | Вычисляемые поля `ckey` и `meta` в datasource `decort_cb_grid` в cloudbroker/grid |
+| BATF-1333 | Вычисляемые поля `networks`, `cpu_allocation_ratio_vm`, `cpu_allocation_ratio` и `custom_backup_path` в datasource `decort_cb_grid_get_settings` в cloudbroker/grid |
+
+#### kvmvm
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1343 | Вычисляемое поле `migrate_storage_info` в datasource `decort_cb_kvmvm_migrate_storage_info` в cloudbroker/kvmvm |
+
+#### node
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1364 | Вычисляемое поле `pmd_cpu` в datasources `decort_cb_node` и `decort_cb_node_list` в cloudbroker/node |
+
+#### user
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1293 | Вычисляемое поле `password` в datasources `decort_cb_user` и `decort_cb_user_list` в cloudbroker/user |
+
+#### SDN netobjgroups
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BATF-1308 | Вычисляемые поля `BridgeNetworkName`, `DefaultGatewayIPv4` `DefaultGatewayIPv6`, `Description`, `ExternalNetworkPorts`, `Hypervisors`, `Status`, `SubnetV4`, `SubnetV6`, `CreatedAt`, `UpdatedAt` и `VLANTag` в datasources `decort_sdn_network_object_group` и `decort_sdn_network_object_group_list` и в resource `decort_sdn_network_object_group` в sdn/netobjgroups |
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 9973073d..15c280b8 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ ZIPDIR = ./zip
BINARY=${NAME}
WORKPATH= ./examples/terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAMESPACE}/${VERSION}/${OS_ARCH}
MAINPATH = ./cmd/decort/
-VERSION=4.12.2
+VERSION=4.13.0
OS_ARCH=$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH)
FILES = ${BINARY}_${VERSION}_darwin_amd64\
@@ -45,8 +45,8 @@ st:
build:
go build -o ${BINARY} ${MAINPATH}
+release: export CGO_ENABLED=0
release: $(FILES)
-
$(FILES) : $(BINDIR) $(ZIPDIR) $(BINS)
zip -r $(ZIPDIR)/$@.zip $(BINDIR)/$@
zip -rj $(ZIPDIR)/$@.zip scripts/install.bat scripts/install.sh
@@ -83,3 +83,12 @@ test:
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
+
+.PHONY: tfdocs
+tfdocs:
+ rm -rf docs/*
+ tfplugindocs generate \
+ --provider-dir=./cmd/decort \
+ --provider-name=terraform-provider-decort \
+ --rendered-provider-name=terraform-provider-decort \
+ --rendered-website-dir=../../docs
\ No newline at end of file
diff --git a/README.md b/README.md
index f379f63d..0f804505 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,7 @@ Terraform provider для платформы Digital Energy Cloud Orchestration
| Версия DECORT API | Версия провайдера Terraform |
| ------ | ------ |
+| 4.7.0 | 4.13.x |
| 4.6.0 | 4.12.x |
| 4.5.0 | 4.11.x |
| 4.4.0 | 4.10.x |
diff --git a/docs/data-sources/cb_disk.md b/docs/data-sources/cb_disk.md
index 28751371..6ab8f73e 100644
--- a/docs/data-sources/cb_disk.md
+++ b/docs/data-sources/cb_disk.md
@@ -28,11 +28,11 @@ description: |-
- `account_id` (Number)
- `account_name` (String)
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `boot_partition` (Number)
- `cache` (String)
- `computes` (List of Object) (see [below for nested schema](#nestedatt--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedatt--computes_read_only))
- `created_by` (String)
- `created_time` (Number)
- `deleted_by` (String)
@@ -40,6 +40,7 @@ description: |-
- `desc` (String)
- `destruction_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_name` (String)
- `disk_path` (String)
- `gid` (Number)
@@ -103,6 +104,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `iotune`
@@ -143,6 +153,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `reference_id` (String)
- `res_id` (String)
- `snap_set_guid` (String)
diff --git a/docs/data-sources/cb_disk_list.md b/docs/data-sources/cb_disk_list.md
index 505986f6..441faf26 100644
--- a/docs/data-sources/cb_disk_list.md
+++ b/docs/data-sources/cb_disk_list.md
@@ -57,11 +57,11 @@ Read-Only:
- `account_id` (Number)
- `account_name` (String)
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `boot_partition` (Number)
- `cache` (String)
- `computes` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes_read_only))
- `created_by` (String)
- `created_time` (Number)
- `deleted_by` (String)
@@ -69,6 +69,7 @@ Read-Only:
- `desc` (String)
- `destruction_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number)
- `disk_name` (String)
- `disk_path` (String)
@@ -123,6 +124,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `items.computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `items.iotune`
@@ -163,6 +173,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `reference_id` (String)
- `res_id` (String)
- `snap_set_guid` (String)
diff --git a/docs/data-sources/cb_disk_list_deleted.md b/docs/data-sources/cb_disk_list_deleted.md
index 86318a6c..6a449ea2 100644
--- a/docs/data-sources/cb_disk_list_deleted.md
+++ b/docs/data-sources/cb_disk_list_deleted.md
@@ -51,11 +51,11 @@ Read-Only:
- `account_id` (Number)
- `account_name` (String)
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `boot_partition` (Number)
- `cache` (String)
- `computes` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes_read_only))
- `created_by` (String)
- `created_time` (Number)
- `deleted_by` (String)
@@ -63,6 +63,7 @@ Read-Only:
- `desc` (String)
- `destruction_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number)
- `disk_name` (String)
- `disk_path` (String)
@@ -117,6 +118,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `items.computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `items.iotune`
@@ -157,6 +167,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `reference_id` (String)
- `res_id` (String)
- `snap_set_guid` (String)
diff --git a/docs/data-sources/cb_disk_list_unattached.md b/docs/data-sources/cb_disk_list_unattached.md
index 01bde6cb..ece3b0ea 100644
--- a/docs/data-sources/cb_disk_list_unattached.md
+++ b/docs/data-sources/cb_disk_list_unattached.md
@@ -54,7 +54,6 @@ Read-Only:
- `account_id` (Number)
- `account_name` (String)
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `boot_partition` (Number)
- `cache` (String)
@@ -62,6 +61,7 @@ Read-Only:
- `deleted_time` (Number)
- `desc` (String)
- `destruction_time` (Number)
+- `discard` (String)
- `disk_id` (Number)
- `disk_name` (String)
- `disk_path` (String)
diff --git a/docs/data-sources/cb_disk_replication.md b/docs/data-sources/cb_disk_replication.md
index 15cff809..1ef8b9f1 100644
--- a/docs/data-sources/cb_disk_replication.md
+++ b/docs/data-sources/cb_disk_replication.md
@@ -133,6 +133,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `reference_id` (String)
- `res_id` (String)
- `snap_set_guid` (String)
diff --git a/docs/data-sources/cb_grid.md b/docs/data-sources/cb_grid.md
index caaf7925..c44fcc33 100644
--- a/docs/data-sources/cb_grid.md
+++ b/docs/data-sources/cb_grid.md
@@ -26,16 +26,17 @@ description: |-
### Read-Only
- `auth_broker` (List of String)
-- `ckey` (String)
- `flag` (String)
- `gid` (Number)
- `guid` (Number)
- `id` (Number) The ID of this resource.
- `location_code` (String)
-- `meta` (List of String) meta
- `name` (String)
- `network_modes` (List of String)
+- `reserved_cpu` (Number)
+- `reserved_ram` (Number)
- `sdn_support` (Boolean)
+- `zero_access_enabled` (Boolean)
### Nested Schema for `timeouts`
diff --git a/docs/data-sources/cb_grid_get_consumption.md b/docs/data-sources/cb_grid_get_consumption.md
index 77c0622d..ee791638 100644
--- a/docs/data-sources/cb_grid_get_consumption.md
+++ b/docs/data-sources/cb_grid_get_consumption.md
@@ -48,9 +48,32 @@ Read-Only:
- `disk_size_max` (Number)
- `ext_ips` (Number)
- `gpu` (Number)
+- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--consumed--policies))
- `ram` (Number)
- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--consumed--seps))
+
+### Nested Schema for `consumed.policies`
+
+Read-Only:
+
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `policy_id` (String)
+- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--consumed--policies--seps))
+
+
+### Nested Schema for `consumed.policies.seps`
+
+Read-Only:
+
+- `data_name` (String)
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `sep_id` (String)
+
+
+
### Nested Schema for `consumed.seps`
@@ -73,9 +96,32 @@ Read-Only:
- `disk_size_max` (Number)
- `ext_ips` (Number)
- `gpu` (Number)
+- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--reserved--policies))
- `ram` (Number)
- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--reserved--seps))
+
+### Nested Schema for `reserved.policies`
+
+Read-Only:
+
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `policy_id` (String)
+- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--reserved--policies--seps))
+
+
+### Nested Schema for `reserved.policies.seps`
+
+Read-Only:
+
+- `data_name` (String)
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `sep_id` (String)
+
+
+
### Nested Schema for `reserved.seps`
diff --git a/docs/data-sources/cb_grid_get_settings.md b/docs/data-sources/cb_grid_get_settings.md
index 824faafe..6706e34b 100644
--- a/docs/data-sources/cb_grid_get_settings.md
+++ b/docs/data-sources/cb_grid_get_settings.md
@@ -32,11 +32,14 @@ description: |-
- `extnet_max_pre_reservations_num` (Number)
- `healthcheck_notifications` (List of Object) (see [below for nested schema](#nestedatt--healthcheck_notifications))
- `id` (String) The ID of this resource.
+- `interface_generation_scheme` (String)
- `k8s_cleanup_enabled` (Boolean)
- `limits` (String)
- `location_url` (String)
+- `mac_address_prefix` (String)
- `net_qos` (List of Object) (see [below for nested schema](#nestedatt--net_qos))
-- `networks` (String)
+- `node_self_stop_timer_uptime_monitor` (Number)
+- `node_self_stop_uptime_monitor` (Boolean)
- `prometheus` (List of Object) (see [below for nested schema](#nestedatt--prometheus))
- `vins_max_pre_reservations_num` (Number)
- `vnfdev_mgmt_net_range` (String)
diff --git a/docs/data-sources/cb_grid_list.md b/docs/data-sources/cb_grid_list.md
index 3287f132..c91debb8 100644
--- a/docs/data-sources/cb_grid_list.md
+++ b/docs/data-sources/cb_grid_list.md
@@ -45,6 +45,7 @@ Optional:
Read-Only:
- `auth_broker` (List of String)
+- `bro_enabled` (Boolean)
- `flag` (String)
- `gid` (Number)
- `guid` (Number)
@@ -52,6 +53,8 @@ Read-Only:
- `location_code` (String)
- `name` (String)
- `network_modes` (List of String)
+- `reserved_cpu` (Number)
+- `reserved_ram` (Number)
- `resources` (List of Object) (see [below for nested schema](#nestedobjatt--items--resources))
- `sdn_support` (Boolean)
- `zero_access_enabled` (Boolean)
@@ -74,9 +77,32 @@ Read-Only:
- `disk_size_max` (Number)
- `ext_ips` (Number)
- `gpu` (Number)
+- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--items--resources--current--policies))
- `ram` (Number)
- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--resources--current--seps))
+
+### Nested Schema for `items.resources.current.policies`
+
+Read-Only:
+
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `policy_id` (String)
+- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--resources--current--policies--seps))
+
+
+### Nested Schema for `items.resources.current.policies.seps`
+
+Read-Only:
+
+- `data_name` (String)
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `sep_id` (String)
+
+
+
### Nested Schema for `items.resources.current.seps`
@@ -99,9 +125,32 @@ Read-Only:
- `disk_size_max` (Number)
- `ext_ips` (Number)
- `gpu` (Number)
+- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--items--resources--reserved--policies))
- `ram` (Number)
- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--resources--reserved--seps))
+
+### Nested Schema for `items.resources.reserved.policies`
+
+Read-Only:
+
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `policy_id` (String)
+- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--resources--reserved--policies--seps))
+
+
+### Nested Schema for `items.resources.reserved.policies.seps`
+
+Read-Only:
+
+- `data_name` (String)
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `sep_id` (String)
+
+
+
### Nested Schema for `items.resources.reserved.seps`
diff --git a/docs/data-sources/cb_grid_list_consumption.md b/docs/data-sources/cb_grid_list_consumption.md
index d495c2bf..3ab5ad15 100644
--- a/docs/data-sources/cb_grid_list_consumption.md
+++ b/docs/data-sources/cb_grid_list_consumption.md
@@ -53,9 +53,32 @@ Read-Only:
- `disk_size_max` (Number)
- `ext_ips` (Number)
- `gpu` (Number)
+- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--items--consumed--policies))
- `ram` (Number)
- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--consumed--seps))
+
+### Nested Schema for `items.consumed.policies`
+
+Read-Only:
+
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `policy_id` (String)
+- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--consumed--policies--seps))
+
+
+### Nested Schema for `items.consumed.policies.seps`
+
+Read-Only:
+
+- `data_name` (String)
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `sep_id` (String)
+
+
+
### Nested Schema for `items.consumed.seps`
@@ -78,9 +101,32 @@ Read-Only:
- `disk_size_max` (Number)
- `ext_ips` (Number)
- `gpu` (Number)
+- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--items--reserved--policies))
- `ram` (Number)
- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--reserved--seps))
+
+### Nested Schema for `items.reserved.policies`
+
+Read-Only:
+
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `policy_id` (String)
+- `seps` (List of Object) (see [below for nested schema](#nestedobjatt--items--reserved--policies--seps))
+
+
+### Nested Schema for `items.reserved.policies.seps`
+
+Read-Only:
+
+- `data_name` (String)
+- `disk_size` (Number)
+- `disk_size_max` (Number)
+- `sep_id` (String)
+
+
+
### Nested Schema for `items.reserved.seps`
diff --git a/docs/data-sources/cb_image_list.md b/docs/data-sources/cb_image_list.md
index e5266720..460b6b8b 100644
--- a/docs/data-sources/cb_image_list.md
+++ b/docs/data-sources/cb_image_list.md
@@ -34,7 +34,7 @@ description: |-
- `status` (String) find by status
- `storage_policy_id` (Number)
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
-- `type_image` (String) find by type
+- `type_image` (List of String) find by type
### Read-Only
@@ -72,7 +72,6 @@ Read-Only:
- `history` (List of Object) (see [below for nested schema](#nestedobjatt--items--history))
- `hot_resize` (Boolean)
- `image_id` (Number)
-- `image_type` (String)
- `independent` (Boolean)
- `last_modified` (Number)
- `link_to` (Number)
@@ -97,6 +96,7 @@ Read-Only:
- `storage_policy_id` (Number)
- `tech_status` (String)
- `to_clean` (Boolean)
+- `type_image` (String)
- `unc_path` (String)
- `url` (String)
- `username` (String)
diff --git a/docs/data-sources/cb_kvmvm.md b/docs/data-sources/cb_kvmvm.md
index 3dfc8f3e..08b40b92 100644
--- a/docs/data-sources/cb_kvmvm.md
+++ b/docs/data-sources/cb_kvmvm.md
@@ -41,9 +41,11 @@ description: |-
- `boot_type` (String)
- `cd_image_id` (Number)
- `chipset` (String)
+- `clock` (String)
- `clone_reference` (Number)
- `clones` (List of Number)
- `computeci_id` (Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedatt--cpu_alignment_profiles))
- `cpu_pin` (Boolean)
- `cpus` (Number)
- `created_by` (String)
@@ -97,6 +99,7 @@ description: |-
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_id` (Number)
- `rg_name` (String)
- `sep_id` (Number)
@@ -163,13 +166,22 @@ Read-Only:
- `value` (String)
+
+### Nested Schema for `cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
### Nested Schema for `disks`
Read-Only:
- `account_id` (Number)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `boot_partition` (Number)
- `bus_number` (Number)
@@ -182,6 +194,7 @@ Read-Only:
- `desc` (String)
- `destruction_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number)
- `disk_path` (String)
- `gid` (Number)
@@ -204,6 +217,7 @@ Read-Only:
- `provision` (String)
- `purge_attempts` (Number)
- `purge_time` (Number)
+- `read_only` (Boolean)
- `reality_device_number` (Number)
- `reference_id` (String)
- `replication` (List of Object) (see [below for nested schema](#nestedobjatt--disks--replication))
@@ -263,6 +277,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
@@ -279,6 +294,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -368,6 +384,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/data-sources/cb_kvmvm_cpu_alignment_profile.md b/docs/data-sources/cb_kvmvm_cpu_alignment_profile.md
new file mode 100644
index 00000000..5decc100
--- /dev/null
+++ b/docs/data-sources/cb_kvmvm_cpu_alignment_profile.md
@@ -0,0 +1,39 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "decort_cb_kvmvm_cpu_alignment_profile Data Source - terraform-provider-decort"
+subcategory: ""
+description: |-
+
+---
+
+# decort_cb_kvmvm_cpu_alignment_profile (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `compute_id` (Number) ID of the compute instance
+
+### Optional
+
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+
+### Read-Only
+
+- `id` (String) The ID of this resource.
+- `model` (String) CPU model of the alignment profile
+- `name` (String) Name of the CPU alignment profile
+- `vendor` (String) CPU vendor of the alignment profile
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `default` (String)
+- `read` (String)
diff --git a/docs/data-sources/cb_kvmvm_list.md b/docs/data-sources/cb_kvmvm_list.md
index 429d0375..5b683807 100644
--- a/docs/data-sources/cb_kvmvm_list.md
+++ b/docs/data-sources/cb_kvmvm_list.md
@@ -73,10 +73,12 @@ Read-Only:
- `bootdisk_size` (Number)
- `cd_image_id` (Number)
- `chipset` (String)
+- `clock` (String)
- `clone_reference` (Number)
- `clones` (List of Number)
- `compute_id` (Number)
- `computeci_id` (Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedobjatt--items--cpu_alignment_profiles))
- `cpu_pin` (Boolean)
- `cpus` (Number)
- `created_by` (String)
@@ -119,6 +121,7 @@ Read-Only:
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_id` (Number)
- `rg_name` (String)
- `snap_sets` (List of Object) (see [below for nested schema](#nestedobjatt--items--snap_sets))
@@ -176,6 +179,16 @@ Read-Only:
- `value` (String)
+
+### Nested Schema for `items.cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
### Nested Schema for `items.disks`
@@ -184,6 +197,7 @@ Read-Only:
- `bus_number` (Number)
- `disk_id` (Number)
- `pci_slot` (Number)
+- `read_only` (Boolean)
- `sep_id` (Number)
@@ -196,6 +210,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -276,6 +291,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/data-sources/cb_kvmvm_list_deleted.md b/docs/data-sources/cb_kvmvm_list_deleted.md
index 5138f95b..1d7ecd21 100644
--- a/docs/data-sources/cb_kvmvm_list_deleted.md
+++ b/docs/data-sources/cb_kvmvm_list_deleted.md
@@ -67,10 +67,12 @@ Read-Only:
- `bootdisk_size` (Number)
- `cd_image_id` (Number)
- `chipset` (String)
+- `clock` (String)
- `clone_reference` (Number)
- `clones` (List of Number)
- `compute_id` (Number)
- `computeci_id` (Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedobjatt--items--cpu_alignment_profiles))
- `cpu_pin` (Boolean)
- `cpus` (Number)
- `created_by` (String)
@@ -109,6 +111,7 @@ Read-Only:
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_id` (Number)
- `rg_name` (String)
- `snap_sets` (List of Object) (see [below for nested schema](#nestedobjatt--items--snap_sets))
@@ -166,6 +169,16 @@ Read-Only:
- `value` (String)
+
+### Nested Schema for `items.cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
### Nested Schema for `items.disks`
@@ -173,6 +186,7 @@ Read-Only:
- `disk_id` (Number)
- `pci_slot` (Number)
+- `read_only` (Boolean)
- `sep_id` (Number)
@@ -185,6 +199,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -253,6 +268,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/data-sources/cb_kvmvm_migrate_storage_info.md b/docs/data-sources/cb_kvmvm_migrate_storage_info.md
index c149bec8..e479129e 100644
--- a/docs/data-sources/cb_kvmvm_migrate_storage_info.md
+++ b/docs/data-sources/cb_kvmvm_migrate_storage_info.md
@@ -25,8 +25,31 @@ description: |-
### Read-Only
+- `completed` (Boolean)
+- `cpu_set` (String)
+- `daemon_addr` (String)
+- `domain_name` (String)
+- `domain_uuid` (String)
+- `elapsed_time` (Number)
+- `gid` (Number)
+- `guid` (Number)
- `id` (String) The ID of this resource.
-- `migrate_storage_info` (String)
+- `interfaces` (List of Object) (see [below for nested schema](#nestedatt--interfaces))
+- `log` (List of String)
+- `migration_id` (Number)
+- `new_disk_xmls` (List of String)
+- `new_disks` (List of Number)
+- `old_disks` (List of Number)
+- `pid` (Number)
+- `source_node_id` (Number)
+- `source_numa_node_id` (Number)
+- `source_reserved_node_cpus` (List of Number)
+- `source_url` (String)
+- `status` (String)
+- `target_node_id` (Number)
+- `target_shadow_compute` (List of Object) (see [below for nested schema](#nestedatt--target_shadow_compute))
+- `target_url` (String)
+- `vmlog_dir` (String)
### Nested Schema for `timeouts`
@@ -35,3 +58,294 @@ Optional:
- `default` (String)
- `read` (String)
+
+
+
+### Nested Schema for `interfaces`
+
+Read-Only:
+
+- `bus_number` (Number)
+- `conn_id` (Number)
+- `conn_type` (String)
+- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
+- `enable_secgroups` (Boolean)
+- `enabled` (Boolean)
+- `flip_group_id` (Number)
+- `guid` (String)
+- `ip_address` (String)
+- `libvirt_settings` (List of Object) (see [below for nested schema](#nestedobjatt--interfaces--libvirt_settings))
+- `listen_ssh` (Boolean)
+- `mac` (String)
+- `mtu` (Number)
+- `name` (String)
+- `net_id` (Number)
+- `net_mask` (Number)
+- `net_type` (String)
+- `node_id` (Number)
+- `pci_slot` (Number)
+- `qos` (List of Object) (see [below for nested schema](#nestedobjatt--interfaces--qos))
+- `sdn_interface_id` (String)
+- `security_groups` (List of Number)
+- `target` (String)
+- `trunk_tags` (List of Number)
+- `type` (String)
+- `vnfs` (List of Number)
+
+
+### Nested Schema for `interfaces.libvirt_settings`
+
+Read-Only:
+
+- `event_idx` (String)
+- `guid` (String)
+- `ioeventfd` (String)
+- `queues` (Number)
+- `rx_queue_size` (Number)
+- `tx_queue_size` (Number)
+- `txmode` (String)
+
+
+
+### Nested Schema for `interfaces.qos`
+
+Read-Only:
+
+- `e_rate` (Number)
+- `guid` (String)
+- `in_brust` (Number)
+- `in_rate` (Number)
+
+
+
+
+### Nested Schema for `target_shadow_compute`
+
+Read-Only:
+
+- `account_id` (Number)
+- `acl` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--acl))
+- `affinity_label` (String)
+- `affinity_rules` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--affinity_rules))
+- `affinity_weight` (Number)
+- `anti_affinity_rules` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--anti_affinity_rules))
+- `arch` (String)
+- `auto_start` (Boolean)
+- `boot_image_id` (Number)
+- `boot_order` (List of String)
+- `boot_type` (String)
+- `bootdisk_size` (Number)
+- `cd_image_id` (Number)
+- `chipset` (String)
+- `clock` (String)
+- `clone_reference` (Number)
+- `clones` (List of Number)
+- `computeci_id` (Number)
+- `cpu_alignment_profile` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--cpu_alignment_profile))
+- `cpupin` (Boolean)
+- `cpus` (Number)
+- `custom_fields` (String)
+- `desc` (String)
+- `devices` (String)
+- `disks` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--disks))
+- `driver` (String)
+- `gid` (Number)
+- `guid` (Number)
+- `hot_resize` (Boolean)
+- `hp_backed` (Boolean)
+- `id` (Number)
+- `interfaces` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--interfaces))
+- `live_migration_job_id` (Number)
+- `loader_type` (String)
+- `lock_status` (String)
+- `manager_id` (Number)
+- `manager_type` (String)
+- `migrationjob` (Number)
+- `milestones` (Number)
+- `name` (String)
+- `need_reboot` (Boolean)
+- `network_interface_naming` (String)
+- `node_id` (Number)
+- `numa_affinity` (String)
+- `numa_node_id` (Number)
+- `os_users` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--os_users))
+- `os_version` (String)
+- `pinned_to_node` (Number)
+- `preferred_cpu` (List of Number)
+- `qemu_guest` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--qemu_guest))
+- `ram` (Number)
+- `read_only` (Boolean)
+- `reference_id` (String)
+- `res_name` (String)
+- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
+- `rg_id` (Number)
+- `snap_sets` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--snap_sets))
+- `stateless_sep_id` (Number)
+- `stateless_sep_type` (String)
+- `status` (String)
+- `tags` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--tags))
+- `tech_status` (String)
+- `user_managed` (Boolean)
+- `userdata` (String)
+- `vgpus` (List of Number)
+- `vnc_passwd` (String)
+- `weight` (Number)
+- `zone_id` (Number)
+
+
+### Nested Schema for `target_shadow_compute.acl`
+
+Read-Only:
+
+- `explicit` (Boolean)
+- `guid` (String)
+- `right` (String)
+- `status` (String)
+- `type` (String)
+- `user_group_id` (String)
+
+
+
+### Nested Schema for `target_shadow_compute.affinity_rules`
+
+Read-Only:
+
+- `key` (String)
+- `mode` (String)
+- `policy` (String)
+- `topology` (String)
+- `value` (String)
+
+
+
+### Nested Schema for `target_shadow_compute.anti_affinity_rules`
+
+Read-Only:
+
+- `key` (String)
+- `mode` (String)
+- `policy` (String)
+- `topology` (String)
+- `value` (String)
+
+
+
+### Nested Schema for `target_shadow_compute.cpu_alignment_profile`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
+
+### Nested Schema for `target_shadow_compute.disks`
+
+Read-Only:
+
+- `id` (Number)
+
+
+
+### Nested Schema for `target_shadow_compute.interfaces`
+
+Read-Only:
+
+- `bus_number` (Number)
+- `conn_id` (Number)
+- `conn_type` (String)
+- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
+- `enable_secgroups` (Boolean)
+- `enabled` (Boolean)
+- `flip_group_id` (Number)
+- `guid` (String)
+- `ip_address` (String)
+- `libvirt_settings` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--interfaces--libvirt_settings))
+- `listen_ssh` (Boolean)
+- `mac` (String)
+- `mtu` (Number)
+- `name` (String)
+- `net_id` (Number)
+- `net_mask` (Number)
+- `net_type` (String)
+- `node_id` (Number)
+- `pci_slot` (Number)
+- `qos` (List of Object) (see [below for nested schema](#nestedobjatt--target_shadow_compute--interfaces--qos))
+- `sdn_interface_id` (String)
+- `security_groups` (List of Number)
+- `target` (String)
+- `trunk_tags` (List of Number)
+- `type` (String)
+- `vnfs` (List of Number)
+
+
+### Nested Schema for `target_shadow_compute.interfaces.libvirt_settings`
+
+Read-Only:
+
+- `event_idx` (String)
+- `guid` (String)
+- `ioeventfd` (String)
+- `queues` (Number)
+- `rx_queue_size` (Number)
+- `tx_queue_size` (Number)
+- `txmode` (String)
+
+
+
+### Nested Schema for `target_shadow_compute.interfaces.qos`
+
+Read-Only:
+
+- `e_rate` (Number)
+- `guid` (String)
+- `in_brust` (Number)
+- `in_rate` (Number)
+
+
+
+
+### Nested Schema for `target_shadow_compute.os_users`
+
+Read-Only:
+
+- `guid` (String)
+- `login` (String)
+- `password` (String)
+- `public_key` (String)
+
+
+
+### Nested Schema for `target_shadow_compute.qemu_guest`
+
+Read-Only:
+
+- `enabled` (Boolean)
+- `enabled_agent_features` (List of String)
+- `guid` (String)
+- `last_update` (Number)
+- `user` (String)
+
+
+
+### Nested Schema for `target_shadow_compute.snap_sets`
+
+Read-Only:
+
+- `disks` (List of Number)
+- `guid` (String)
+- `label` (String)
+- `timestamp` (Number)
+
+
+
+### Nested Schema for `target_shadow_compute.tags`
+
+Read-Only:
+
+- `key` (String)
+- `val` (String)
diff --git a/docs/data-sources/cb_node.md b/docs/data-sources/cb_node.md
index 73d30862..49fa158e 100644
--- a/docs/data-sources/cb_node.md
+++ b/docs/data-sources/cb_node.md
@@ -44,7 +44,9 @@ description: |-
- `nic_info` (List of Object) (see [below for nested schema](#nestedatt--nic_info))
- `numa_topology` (List of Object) (see [below for nested schema](#nestedatt--numa_topology))
- `openvswitch_bridges` (List of String)
+- `reserved_cpu` (Number)
- `reserved_cpus` (List of String)
+- `reserved_ram` (Number)
- `roles` (List of String)
- `sdn_hypervisor_name` (String)
- `sriov_enabled` (Boolean)
@@ -134,7 +136,7 @@ Read-Only:
- `bridges` (List of Object) (see [below for nested schema](#nestedobjatt--dpdk--bridges))
- `hp_memory` (Map of Number)
-- `pmd_cpu` (List of Number)
+- `ovs_dpdk_cores` (List of Number)
### Nested Schema for `dpdk.bridges`
@@ -208,8 +210,17 @@ Read-Only:
Read-Only:
- `one_g` (Number)
+- `one_g_available` (Number)
+- `one_g_dpdk_reserved` (Number)
+- `one_g_free` (Number)
+- `one_g_reserved` (Number)
+- `one_g_used` (Number)
- `total` (Number)
- `two_m` (Number)
+- `two_m_available` (Number)
+- `two_m_free` (Number)
+- `two_m_reserved` (Number)
+- `two_m_used` (Number)
diff --git a/docs/data-sources/cb_node_list.md b/docs/data-sources/cb_node_list.md
index ba7b78bf..bace8f9b 100644
--- a/docs/data-sources/cb_node_list.md
+++ b/docs/data-sources/cb_node_list.md
@@ -66,6 +66,7 @@ Read-Only:
- `isolated_cpus` (List of String)
- `lastcheck` (Number)
- `machine_guid` (String)
+- `machine_id` (String)
- `mainboard_sn` (String)
- `mem_allocation_ratio` (Number)
- `memory` (Number)
@@ -82,13 +83,16 @@ Read-Only:
- `old_compat_lvm_id` (Number)
- `openvswitch_bridges` (List of String)
- `packages` (List of Object) (see [below for nested schema](#nestedobjatt--items--packages))
+- `pci_devices` (List of Object) (see [below for nested schema](#nestedobjatt--items--pci_devices))
- `peer_backup` (Number)
- `peer_log` (Number)
- `peer_stats` (Number)
- `pgpus` (List of Number)
- `public_keys` (List of String)
- `release` (String)
+- `reserved_cpu` (Number)
- `reserved_cpus` (List of String)
+- `reserved_ram` (Number)
- `roles` (List of String)
- `sdn_hypervisor_name` (String)
- `seps` (List of Number)
@@ -122,7 +126,7 @@ Read-Only:
- `bridges` (List of Object) (see [below for nested schema](#nestedobjatt--items--dpdk--bridges))
- `hp_memory` (Map of Number)
-- `pmd_cpu` (List of Number)
+- `ovs_dpdk_cores` (List of Number)
### Nested Schema for `items.dpdk.bridges`
@@ -200,8 +204,17 @@ Read-Only:
Read-Only:
- `one_g` (Number)
+- `one_g_available` (Number)
+- `one_g_dpdk_reserved` (Number)
+- `one_g_free` (Number)
+- `one_g_reserved` (Number)
+- `one_g_used` (Number)
- `total` (Number)
- `two_m` (Number)
+- `two_m_available` (Number)
+- `two_m_free` (Number)
+- `two_m_reserved` (Number)
+- `two_m_used` (Number)
@@ -213,3 +226,18 @@ Read-Only:
- `size` (String)
- `ver` (String)
+
+
+
+### Nested Schema for `items.pci_devices`
+
+Read-Only:
+
+- `current_driver` (String)
+- `hw_path` (String)
+- `iommu_group` (Number)
+- `numa_node` (Number)
+- `product_id` (String)
+- `product_name` (String)
+- `vendor_id` (String)
+- `vendor_name` (String)
diff --git a/docs/data-sources/cb_node_network_info.md b/docs/data-sources/cb_node_network_info.md
new file mode 100644
index 00000000..b36d64d4
--- /dev/null
+++ b/docs/data-sources/cb_node_network_info.md
@@ -0,0 +1,182 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "decort_cb_node_network_info Data Source - terraform-provider-decort"
+subcategory: ""
+description: |-
+
+---
+
+# decort_cb_node_network_info (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `node_id` (Number) Node ID
+
+### Optional
+
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+
+### Read-Only
+
+- `id` (String) The ID of this resource.
+- `libvirt_networks_info` (List of Object) VM network interface connections (see [below for nested schema](#nestedatt--libvirt_networks_info))
+- `ovs_networks_info` (List of Object) Raw OVS ports data (see [below for nested schema](#nestedatt--ovs_networks_info))
+- `system_networks_info` (List of Object) System-level information about all network interfaces on the node (see [below for nested schema](#nestedatt--system_networks_info))
+- `topology` (List of Object) Assembled network topology of the node (see [below for nested schema](#nestedatt--topology))
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `default` (String)
+- `read` (String)
+
+
+
+### Nested Schema for `libvirt_networks_info`
+
+Read-Only:
+
+- `interface` (String)
+- `interface_source` (String)
+- `interface_type` (String)
+- `vm_name` (String)
+
+
+
+### Nested Schema for `ovs_networks_info`
+
+Read-Only:
+
+- `bridge_name` (String)
+- `bridge_tag` (String)
+- `interface_ip` (String)
+- `interface_mac` (String)
+- `interface_mtu` (Number)
+- `interface_name` (String)
+- `interface_peer` (String)
+- `interface_type` (String)
+- `interface_uuid` (String)
+
+
+
+### Nested Schema for `system_networks_info`
+
+Read-Only:
+
+- `bport_id` (String)
+- `bridge_id` (String)
+- `mac` (String)
+- `mtu` (Number)
+- `name` (String)
+- `speed` (Number)
+
+
+
+### Nested Schema for `topology`
+
+Read-Only:
+
+- `interfaces` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces))
+
+
+### Nested Schema for `topology.interfaces`
+
+Read-Only:
+
+- `bridge_connections` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces--bridge_connections))
+- `bridge_id` (String)
+- `bridge_info` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces--bridge_info))
+- `connected_interfaces` (List of String)
+- `connections` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces--connections))
+- `mtu` (Number)
+- `name` (String)
+- `peer` (String)
+- `speed` (Number)
+- `type` (String)
+- `uuid` (String)
+- `vlans` (List of String)
+
+
+### Nested Schema for `topology.interfaces.bridge_connections`
+
+Read-Only:
+
+- `name` (String)
+- `via` (String)
+- `vlan` (String)
+
+
+
+### Nested Schema for `topology.interfaces.bridge_info`
+
+Read-Only:
+
+- `ports` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces--bridge_info--ports))
+- `type` (String)
+
+
+### Nested Schema for `topology.interfaces.bridge_info.ports`
+
+Read-Only:
+
+- `ip` (String)
+- `mac` (String)
+- `mtu` (Number)
+- `name` (String)
+- `type` (String)
+- `uuid` (String)
+- `vlan` (String)
+
+
+
+
+### Nested Schema for `topology.interfaces.connections`
+
+Read-Only:
+
+- `bridges` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces--connections--bridges))
+- `vms` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces--connections--vms))
+
+
+### Nested Schema for `topology.interfaces.connections.bridges`
+
+Read-Only:
+
+- `bport_id` (String)
+- `name` (String)
+- `port_info` (List of Object) (see [below for nested schema](#nestedobjatt--topology--interfaces--connections--bridges--port_info))
+- `type` (String)
+- `via` (String)
+
+
+### Nested Schema for `topology.interfaces.connections.bridges.port_info`
+
+Read-Only:
+
+- `mtu` (Number)
+- `name` (String)
+- `type` (String)
+- `uuid` (String)
+- `vlan` (String)
+
+
+
+
+### Nested Schema for `topology.interfaces.connections.vms`
+
+Read-Only:
+
+- `connection_type` (String)
+- `name` (String)
+- `via_bridge` (String)
+- `vm_interface` (String)
+- `vm_interface_type` (String)
diff --git a/docs/data-sources/cb_node_pci_devices.md b/docs/data-sources/cb_node_pci_devices.md
new file mode 100644
index 00000000..bffe6e81
--- /dev/null
+++ b/docs/data-sources/cb_node_pci_devices.md
@@ -0,0 +1,57 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "decort_cb_node_pci_devices Data Source - terraform-provider-decort"
+subcategory: ""
+description: |-
+
+---
+
+# decort_cb_node_pci_devices (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `node_id` (Number) Node ID
+
+### Optional
+
+- `page` (Number) Page number
+- `search` (String) Search string
+- `size` (Number) Page size
+- `sort_by` (String) Sort by one of supported fields, format +|-(field)
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+
+### Read-Only
+
+- `entry_count` (Number) Total number of PCI devices
+- `id` (String) The ID of this resource.
+- `items` (List of Object) List of PCI devices (see [below for nested schema](#nestedatt--items))
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `default` (String)
+- `read` (String)
+
+
+
+### Nested Schema for `items`
+
+Read-Only:
+
+- `current_driver` (String)
+- `hw_path` (String)
+- `iommu_group` (Number)
+- `numa_node` (Number)
+- `product_id` (String)
+- `product_name` (String)
+- `vendor_id` (String)
+- `vendor_name` (String)
diff --git a/docs/data-sources/cb_rg_list.md b/docs/data-sources/cb_rg_list.md
index b0b1cb4f..e1dd9149 100644
--- a/docs/data-sources/cb_rg_list.md
+++ b/docs/data-sources/cb_rg_list.md
@@ -88,6 +88,7 @@ Read-Only:
Read-Only:
+- `email` (String)
- `explicit` (Boolean)
- `guid` (String)
- `right` (String)
diff --git a/docs/data-sources/cb_rg_list_deleted.md b/docs/data-sources/cb_rg_list_deleted.md
index 1d2e05e2..eab35612 100644
--- a/docs/data-sources/cb_rg_list_deleted.md
+++ b/docs/data-sources/cb_rg_list_deleted.md
@@ -86,6 +86,7 @@ Read-Only:
Read-Only:
+- `email` (String)
- `explicit` (Boolean)
- `guid` (String)
- `right` (String)
diff --git a/docs/data-sources/cb_sep_consumption.md b/docs/data-sources/cb_sep_consumption.md
index 2341a8e3..85ce4525 100644
--- a/docs/data-sources/cb_sep_consumption.md
+++ b/docs/data-sources/cb_sep_consumption.md
@@ -15,20 +15,16 @@ description: |-
## Schema
-### Required
-
-- `sep_id` (Number) sep id
-
### Optional
+- `sep_id` (Number) sep id
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
### Read-Only
-- `by_pool` (List of Object) consumption divided by pool (see [below for nested schema](#nestedatt--by_pool))
+- `entry_count` (Number) number of entries
- `id` (String) The ID of this resource.
-- `total` (List of Object) total consumption (see [below for nested schema](#nestedatt--total))
-- `type` (String) sep type
+- `items` (List of Object) list of sep consumption records (see [below for nested schema](#nestedatt--items))
### Nested Schema for `timeouts`
@@ -39,8 +35,20 @@ Optional:
- `read` (String)
-
-### Nested Schema for `by_pool`
+
+### Nested Schema for `items`
+
+Read-Only:
+
+- `by_pool` (List of Object) (see [below for nested schema](#nestedobjatt--items--by_pool))
+- `consumed_by` (List of Number)
+- `name` (String)
+- `sep_id` (Number)
+- `total` (List of Object) (see [below for nested schema](#nestedobjatt--items--total))
+- `type` (String)
+
+
+### Nested Schema for `items.by_pool`
Read-Only:
@@ -53,8 +61,8 @@ Read-Only:
- `usage_limit` (Number)
-
-### Nested Schema for `total`
+
+### Nested Schema for `items.total`
Read-Only:
diff --git a/docs/data-sources/cb_user.md b/docs/data-sources/cb_user.md
index 161328cd..0629c7e0 100644
--- a/docs/data-sources/cb_user.md
+++ b/docs/data-sources/cb_user.md
@@ -42,7 +42,6 @@ description: |-
- `last_check` (Number) last_check
- `meta` (List of String) meta
- `mobile` (List of String) mobile
-- `password` (String) password
- `protected` (Boolean) protected
- `roles` (List of String) roles
- `service_account` (Boolean) service_account
diff --git a/docs/data-sources/cb_user_list.md b/docs/data-sources/cb_user_list.md
index b0e84aa8..034d7588 100644
--- a/docs/data-sources/cb_user_list.md
+++ b/docs/data-sources/cb_user_list.md
@@ -62,7 +62,6 @@ Read-Only:
- `last_check` (Number)
- `meta` (List of String)
- `mobile` (List of String)
-- `password` (String)
- `protected` (Boolean)
- `roles` (List of String)
- `service_account` (Boolean)
diff --git a/docs/data-sources/cb_vins.md b/docs/data-sources/cb_vins.md
index 7b47ec6d..99ce98a5 100644
--- a/docs/data-sources/cb_vins.md
+++ b/docs/data-sources/cb_vins.md
@@ -34,6 +34,7 @@ description: |-
- `deleted_by` (String) deleted by
- `deleted_time` (Number) deleted time
- `description` (String) description
+- `enable_default_gateway` (Boolean)
- `gid` (Number) gid
- `guid` (Number) guid
- `id` (String) The ID of this resource.
diff --git a/docs/data-sources/cb_vins_list.md b/docs/data-sources/cb_vins_list.md
index c9b1b50a..e7f221f1 100644
--- a/docs/data-sources/cb_vins_list.md
+++ b/docs/data-sources/cb_vins_list.md
@@ -60,6 +60,7 @@ Read-Only:
- `deleted_by` (String)
- `deleted_time` (Number)
- `description` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `external_ip` (String)
- `extnet_id` (Number)
diff --git a/docs/data-sources/cb_vins_list_deleted.md b/docs/data-sources/cb_vins_list_deleted.md
index 8a915845..cbd87785 100644
--- a/docs/data-sources/cb_vins_list_deleted.md
+++ b/docs/data-sources/cb_vins_list_deleted.md
@@ -57,6 +57,7 @@ Read-Only:
- `deleted_by` (String)
- `deleted_time` (Number)
- `description` (String)
+- `enable_default_gateway` (Boolean)
- `external_ip` (String)
- `gid` (Number)
- `guid` (Number)
diff --git a/docs/data-sources/cb_zone.md b/docs/data-sources/cb_zone.md
index cc0d3989..c6b739e9 100644
--- a/docs/data-sources/cb_zone.md
+++ b/docs/data-sources/cb_zone.md
@@ -31,6 +31,7 @@ description: |-
- `broadcast_addr` (String)
- `bservice_ids` (List of Number)
- `compute_ids` (List of Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedatt--cpu_alignment_profiles))
- `created_time` (Number)
- `decort_url` (String)
- `deletable` (Boolean)
@@ -48,6 +49,8 @@ description: |-
- `name` (String)
- `node_ids` (List of Number)
- `ping_addr` (String)
+- `reserved_cpu` (Number)
+- `reserved_ram` (Number)
- `ssl_skip_verify` (Boolean)
- `sso_type` (String)
- `sso_url` (String)
@@ -62,3 +65,13 @@ Optional:
- `default` (String)
- `read` (String)
+
+
+
+### Nested Schema for `cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
diff --git a/docs/data-sources/cb_zone_cpu_alignment_profile.md b/docs/data-sources/cb_zone_cpu_alignment_profile.md
new file mode 100644
index 00000000..780cbe76
--- /dev/null
+++ b/docs/data-sources/cb_zone_cpu_alignment_profile.md
@@ -0,0 +1,47 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "decort_cb_zone_cpu_alignment_profile Data Source - terraform-provider-decort"
+subcategory: ""
+description: |-
+
+---
+
+# decort_cb_zone_cpu_alignment_profile (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `zone_id` (Number)
+
+### Optional
+
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+
+### Read-Only
+
+- `id` (String) The ID of this resource.
+- `profiles` (List of Object) (see [below for nested schema](#nestedatt--profiles))
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `default` (String)
+- `read` (String)
+
+
+
+### Nested Schema for `profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
diff --git a/docs/data-sources/cb_zone_cpu_alignment_profile_list.md b/docs/data-sources/cb_zone_cpu_alignment_profile_list.md
new file mode 100644
index 00000000..8fee1bb0
--- /dev/null
+++ b/docs/data-sources/cb_zone_cpu_alignment_profile_list.md
@@ -0,0 +1,53 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "decort_cb_zone_cpu_alignment_profile_list Data Source - terraform-provider-decort"
+subcategory: ""
+description: |-
+
+---
+
+# decort_cb_zone_cpu_alignment_profile_list (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Optional
+
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+- `zone_id` (Number)
+
+### Read-Only
+
+- `entry_count` (Number)
+- `id` (String) The ID of this resource.
+- `items` (List of Object) (see [below for nested schema](#nestedatt--items))
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `default` (String)
+- `read` (String)
+
+
+
+### Nested Schema for `items`
+
+Read-Only:
+
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedobjatt--items--cpu_alignment_profiles))
+- `zone_id` (Number)
+
+
+### Nested Schema for `items.cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
diff --git a/docs/data-sources/cb_zone_cpu_alignment_profile_test.md b/docs/data-sources/cb_zone_cpu_alignment_profile_test.md
new file mode 100644
index 00000000..dd3f3c8a
--- /dev/null
+++ b/docs/data-sources/cb_zone_cpu_alignment_profile_test.md
@@ -0,0 +1,74 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "decort_cb_zone_cpu_alignment_profile_test Data Source - terraform-provider-decort"
+subcategory: ""
+description: |-
+
+---
+
+# decort_cb_zone_cpu_alignment_profile_test (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `zone_id` (Number)
+
+### Optional
+
+- `hypervisor_similarity_in_percentage` (Number)
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+
+### Read-Only
+
+- `candidates` (List of Object) (see [below for nested schema](#nestedatt--candidates))
+- `id` (String) The ID of this resource.
+- `profiles` (List of Object) (see [below for nested schema](#nestedatt--profiles))
+- `supported_cpu_models` (List of Object) (see [below for nested schema](#nestedatt--supported_cpu_models))
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `default` (String)
+- `read` (String)
+
+
+
+### Nested Schema for `candidates`
+
+Read-Only:
+
+- `count` (Number)
+- `model` (String)
+- `name` (String)
+- `percentage` (Number)
+- `required_count` (Number)
+- `vendor` (String)
+
+
+
+### Nested Schema for `profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
+
+### Nested Schema for `supported_cpu_models`
+
+Read-Only:
+
+- `count` (Number)
+- `model` (String)
+- `percentage` (Number)
+- `vendor` (String)
diff --git a/docs/data-sources/cb_zone_list.md b/docs/data-sources/cb_zone_list.md
index 7fab8233..f294429b 100644
--- a/docs/data-sources/cb_zone_list.md
+++ b/docs/data-sources/cb_zone_list.md
@@ -52,6 +52,7 @@ Read-Only:
- `app_id` (String)
- `auto_start` (Boolean)
- `broadcast_addr` (String)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedobjatt--items--cpu_alignment_profiles))
- `created_time` (Number)
- `decort_url` (String)
- `deletable` (Boolean)
@@ -65,9 +66,20 @@ Read-Only:
- `name` (String)
- `node_ids` (List of Number)
- `ping_addr` (String)
+- `reserved_cpu` (Number)
+- `reserved_ram` (Number)
- `ssl_skip_verify` (Boolean)
- `sso_type` (String)
- `sso_url` (String)
- `status` (String)
- `updated_time` (Number)
- `zone_id` (Number)
+
+
+### Nested Schema for `items.cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
diff --git a/docs/data-sources/disk.md b/docs/data-sources/disk.md
index f280ec60..eb5df40c 100644
--- a/docs/data-sources/disk.md
+++ b/docs/data-sources/disk.md
@@ -28,10 +28,10 @@ description: |-
- `account_id` (Number) The unique ID of the subscriber-owner of the disk
- `account_name` (String) The name of the subscriber '(account') to whom this disk belongs
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `cache` (String)
- `computes` (List of Object) (see [below for nested schema](#nestedatt--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedatt--computes_read_only))
- `created_by` (String)
- `created_time` (Number) Created time
- `deleted_by` (String)
@@ -39,6 +39,7 @@ description: |-
- `desc` (String) Description of disk
- `destruction_time` (Number) Time of final deletion
- `devicename` (String) Name of the device
+- `discard` (String)
- `disk_name` (String) Name of disk
- `gid` (Number) ID of the grid (platform)
- `id` (String) The ID of this resource.
@@ -94,6 +95,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `iotune`
@@ -134,6 +144,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
diff --git a/docs/data-sources/disk_list.md b/docs/data-sources/disk_list.md
index aa1acbf0..14f749a3 100644
--- a/docs/data-sources/disk_list.md
+++ b/docs/data-sources/disk_list.md
@@ -57,10 +57,10 @@ Read-Only:
- `account_id` (Number)
- `account_name` (String)
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `cache` (String)
- `computes` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes_read_only))
- `created_by` (String)
- `created_time` (Number)
- `deleted_by` (String)
@@ -68,6 +68,7 @@ Read-Only:
- `desc` (String)
- `destruction_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number)
- `disk_name` (String)
- `gid` (Number)
@@ -114,6 +115,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `items.computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `items.iotune`
@@ -154,6 +164,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
diff --git a/docs/data-sources/disk_list_deleted.md b/docs/data-sources/disk_list_deleted.md
index afdaec8c..a7ed53cb 100644
--- a/docs/data-sources/disk_list_deleted.md
+++ b/docs/data-sources/disk_list_deleted.md
@@ -51,10 +51,10 @@ Read-Only:
- `account_id` (Number)
- `account_name` (String)
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `cache` (String)
- `computes` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedobjatt--items--computes_read_only))
- `created_by` (String)
- `created_time` (Number)
- `deleted_by` (String)
@@ -62,6 +62,7 @@ Read-Only:
- `desc` (String)
- `destruction_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number)
- `disk_name` (String)
- `gid` (Number)
@@ -108,6 +109,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `items.computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `items.iotune`
@@ -148,6 +158,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
diff --git a/docs/data-sources/disk_list_unattached.md b/docs/data-sources/disk_list_unattached.md
index c21236b1..6aaea2a3 100644
--- a/docs/data-sources/disk_list_unattached.md
+++ b/docs/data-sources/disk_list_unattached.md
@@ -54,7 +54,6 @@ Read-Only:
- `account_id` (Number)
- `account_name` (String)
- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `boot_partition` (Number)
- `cache` (String)
@@ -62,6 +61,7 @@ Read-Only:
- `deleted_time` (Number)
- `desc` (String)
- `destruction_time` (Number)
+- `discard` (String)
- `disk_id` (Number)
- `disk_name` (String)
- `disk_path` (String)
@@ -125,6 +125,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
diff --git a/docs/data-sources/disk_replication.md b/docs/data-sources/disk_replication.md
index 2d83f8eb..21e42807 100644
--- a/docs/data-sources/disk_replication.md
+++ b/docs/data-sources/disk_replication.md
@@ -121,6 +121,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
diff --git a/docs/data-sources/extnet_list.md b/docs/data-sources/extnet_list.md
index bcdf894e..f595b5cd 100644
--- a/docs/data-sources/extnet_list.md
+++ b/docs/data-sources/extnet_list.md
@@ -51,6 +51,7 @@ Optional:
Read-Only:
+- `free_ips` (Number)
- `ipcidr` (String)
- `name` (String)
- `net_id` (Number)
diff --git a/docs/data-sources/image_list.md b/docs/data-sources/image_list.md
index 1b41ae20..87cede09 100644
--- a/docs/data-sources/image_list.md
+++ b/docs/data-sources/image_list.md
@@ -34,7 +34,7 @@ description: |-
- `status` (String) Filter by status
- `storage_policy_id` (Number)
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
-- `type_image` (String) Filter by image type
+- `type_image` (List of String) Filter by image type
### Read-Only
@@ -74,6 +74,6 @@ Read-Only:
- `size` (Number)
- `status` (String)
- `storage_policy_id` (Number)
-- `type` (String)
+- `type_image` (String)
- `username` (String)
- `virtual` (Boolean)
diff --git a/docs/data-sources/kvmvm.md b/docs/data-sources/kvmvm.md
index 9088d505..aa895643 100644
--- a/docs/data-sources/kvmvm.md
+++ b/docs/data-sources/kvmvm.md
@@ -40,9 +40,11 @@ description: |-
- `bootdisk_size` (Number)
- `cd_image_id` (Number)
- `chipset` (String)
+- `clock` (String)
- `clone_reference` (Number)
- `clones` (List of Number)
- `computeci_id` (Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedatt--cpu_alignment_profiles))
- `cpu_pin` (Boolean)
- `cpus` (Number)
- `created_by` (String)
@@ -77,6 +79,7 @@ description: |-
- `natable_vins_network_name` (String)
- `need_reboot` (Boolean)
- `network_interface_naming` (String)
+- `node_id` (Number)
- `numa_affinity` (String)
- `numa_node_id` (Number)
- `os_users` (List of Object) (see [below for nested schema](#nestedatt--os_users))
@@ -91,6 +94,7 @@ description: |-
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_id` (Number)
- `rg_name` (String)
- `snap_sets` (List of Object) (see [below for nested schema](#nestedatt--snap_sets))
@@ -192,15 +196,22 @@ Read-Only:
- `value` (String)
+
+### Nested Schema for `cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
### Nested Schema for `disks`
Read-Only:
-- `_ckey` (String)
- `account_id` (Number)
-- `acl` (String)
-- `blk_discard` (Boolean)
- `block_size` (String)
- `boot_partition` (Number)
- `bus_number` (Number)
@@ -212,12 +223,12 @@ Read-Only:
- `description` (String)
- `destruction_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number)
- `disk_path` (String)
- `gid` (Number)
- `guid` (Number)
- `image_id` (Number)
-- `image_name` (String)
- `images` (List of Number)
- `independent` (Boolean)
- `iotune` (List of Object) (see [below for nested schema](#nestedobjatt--disks--iotune))
@@ -233,6 +244,7 @@ Read-Only:
- `present_to` (Map of Number)
- `provision` (String)
- `purge_time` (Number)
+- `read_only` (Boolean)
- `reality_device_number` (Number)
- `replication` (List of Object) (see [below for nested schema](#nestedobjatt--disks--replication))
- `res_id` (String)
@@ -289,7 +301,8 @@ Read-Only:
- `guid` (String)
- `label` (String)
-- `reference_id` (Number)
+- `pool_name` (String)
+- `reference_id` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
@@ -306,6 +319,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -395,6 +409,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/data-sources/kvmvm_cpu_alignment_profile.md b/docs/data-sources/kvmvm_cpu_alignment_profile.md
new file mode 100644
index 00000000..29e31b43
--- /dev/null
+++ b/docs/data-sources/kvmvm_cpu_alignment_profile.md
@@ -0,0 +1,39 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "decort_kvmvm_cpu_alignment_profile Data Source - terraform-provider-decort"
+subcategory: ""
+description: |-
+
+---
+
+# decort_kvmvm_cpu_alignment_profile (Data Source)
+
+
+
+
+
+
+## Schema
+
+### Required
+
+- `compute_id` (Number) ID of the compute instance
+
+### Optional
+
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+
+### Read-Only
+
+- `id` (String) The ID of this resource.
+- `model` (String) CPU model of the alignment profile
+- `name` (String) Name of the CPU alignment profile
+- `vendor` (String) CPU vendor of the alignment profile
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `default` (String)
+- `read` (String)
diff --git a/docs/data-sources/kvmvm_list.md b/docs/data-sources/kvmvm_list.md
index c6c5589d..27257c5a 100644
--- a/docs/data-sources/kvmvm_list.md
+++ b/docs/data-sources/kvmvm_list.md
@@ -70,10 +70,12 @@ Read-Only:
- `bootdisk_size` (Number)
- `cd_image_id` (Number)
- `chipset` (String)
+- `clock` (String)
- `clone_reference` (Number)
- `clones` (List of Number)
- `compute_id` (Number)
- `computeci_id` (Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedobjatt--items--cpu_alignment_profiles))
- `cpu_pin` (Boolean)
- `cpus` (Number)
- `created_by` (String)
@@ -112,6 +114,7 @@ Read-Only:
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_id` (Number)
- `rg_name` (String)
- `snap_sets` (List of Object) (see [below for nested schema](#nestedobjatt--items--snap_sets))
@@ -168,6 +171,16 @@ Read-Only:
- `value` (String)
+
+### Nested Schema for `items.cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
### Nested Schema for `items.disks`
@@ -176,6 +189,7 @@ Read-Only:
- `bus_number` (Number)
- `disk_id` (Number)
- `pci_slot` (Number)
+- `read_only` (Boolean)
- `sep_id` (Number)
@@ -188,6 +202,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -257,6 +272,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/data-sources/kvmvm_list_deleted.md b/docs/data-sources/kvmvm_list_deleted.md
index dade17cf..e5b99570 100644
--- a/docs/data-sources/kvmvm_list_deleted.md
+++ b/docs/data-sources/kvmvm_list_deleted.md
@@ -67,10 +67,12 @@ Read-Only:
- `bootdisk_size` (Number)
- `cd_image_id` (Number)
- `chipset` (String)
+- `clock` (String)
- `clone_reference` (Number)
- `clones` (List of Number)
- `compute_id` (Number)
- `computeci_id` (Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedobjatt--items--cpu_alignment_profiles))
- `cpu_pin` (Boolean)
- `cpus` (Number)
- `created_by` (String)
@@ -109,6 +111,7 @@ Read-Only:
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_id` (Number)
- `rg_name` (String)
- `snap_sets` (List of Object) (see [below for nested schema](#nestedobjatt--items--snap_sets))
@@ -165,6 +168,16 @@ Read-Only:
- `value` (String)
+
+### Nested Schema for `items.cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
+
+
### Nested Schema for `items.disks`
@@ -173,6 +186,7 @@ Read-Only:
- `bus_number` (Number)
- `disk_id` (Number)
- `pci_slot` (Number)
+- `read_only` (Boolean)
- `sep_id` (Number)
@@ -185,6 +199,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -254,6 +269,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/data-sources/sdn_logical_port.md b/docs/data-sources/sdn_logical_port.md
index 137e5434..075e536a 100644
--- a/docs/data-sources/sdn_logical_port.md
+++ b/docs/data-sources/sdn_logical_port.md
@@ -34,6 +34,7 @@ description: |-
- `description` (String) Description of the logical port
- `display_name` (String) Display name of the logical port
- `enabled` (Boolean) If the logical port is enabled
+- `exclude_firewall` (List of Object) (see [below for nested schema](#nestedatt--exclude_firewall))
- `external_network_id` (String)
- `hypervisor` (String) ID of the hypervisor
- `hypervisor_display_name` (String) Display name of the hypervisor
@@ -85,6 +86,16 @@ Read-Only:
+
+### Nested Schema for `exclude_firewall`
+
+Read-Only:
+
+- `exclusion_reason` (String)
+- `logical_port_addresses_excluded` (Boolean)
+- `logical_port_excluded` (Boolean)
+
+
### Nested Schema for `labels`
diff --git a/docs/data-sources/sdn_logical_port_get_by_unique_identifier.md b/docs/data-sources/sdn_logical_port_get_by_unique_identifier.md
index 9911ecb8..20ab9b95 100644
--- a/docs/data-sources/sdn_logical_port_get_by_unique_identifier.md
+++ b/docs/data-sources/sdn_logical_port_get_by_unique_identifier.md
@@ -34,6 +34,7 @@ description: |-
- `description` (String) Description of the logical port
- `display_name` (String) Display name of the logical port
- `enabled` (Boolean) If the logical port is enabled
+- `exclude_firewall` (List of Object) (see [below for nested schema](#nestedatt--exclude_firewall))
- `external_network_id` (String)
- `hypervisor` (String) ID of the hypervisor
- `hypervisor_display_name` (String) Display name of the hypervisor
@@ -84,6 +85,16 @@ Read-Only:
+
+### Nested Schema for `exclude_firewall`
+
+Read-Only:
+
+- `exclusion_reason` (String)
+- `logical_port_addresses_excluded` (Boolean)
+- `logical_port_excluded` (Boolean)
+
+
### Nested Schema for `labels`
diff --git a/docs/data-sources/sdn_logical_port_list.md b/docs/data-sources/sdn_logical_port_list.md
index 948a9d0a..c2325192 100644
--- a/docs/data-sources/sdn_logical_port_list.md
+++ b/docs/data-sources/sdn_logical_port_list.md
@@ -68,6 +68,7 @@ Read-Only:
- `description` (String)
- `display_name` (String)
- `enabled` (Boolean)
+- `exclude_firewall` (List of Object) (see [below for nested schema](#nestedobjatt--items--exclude_firewall))
- `external_network_id` (String)
- `hypervisor` (String)
- `hypervisor_display_name` (String)
@@ -110,6 +111,16 @@ Read-Only:
+
+### Nested Schema for `items.exclude_firewall`
+
+Read-Only:
+
+- `exclusion_reason` (String)
+- `logical_port_addresses_excluded` (Boolean)
+- `logical_port_excluded` (Boolean)
+
+
### Nested Schema for `items.labels`
diff --git a/docs/data-sources/sdn_network_object_group.md b/docs/data-sources/sdn_network_object_group.md
index 6bb5a7b4..384a5b2a 100644
--- a/docs/data-sources/sdn_network_object_group.md
+++ b/docs/data-sources/sdn_network_object_group.md
@@ -81,374 +81,17 @@ Read-Only:
Read-Only:
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `bridge_network_name` (String)
-- `comment` (String)
-- `created_at` (String)
-- `default_gateway_ipv4` (String)
-- `default_gateway_ipv6` (String)
-- `description` (String)
-- `enabled` (Boolean)
-- `external_network_ports` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports))
-- `hypervisors` (List of String)
-- `id` (String)
-- `ipv4` (String)
-- `mac` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--status))
-- `subnet_v4` (String)
-- `subnet_v6` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-- `vlan_tag` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports`
-
-Read-Only:
-
- `access_group_id` (String)
- `access_group_name` (String)
- `comment` (String)
- `display_name` (String)
- `enabled` (Boolean)
-- `floating_ip` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip))
-- `ipv4` (String)
-- `ipv6` (String)
-- `ipv6_config` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--ipv6_config))
-- `mac` (String)
-- `router_gateaway_port` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--router_gateaway_port))
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `logical_port` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port))
-- `router` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `adapter_mac` (String)
-- `address_detection` (Boolean)
-- `bindings` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--bindings))
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `exclude_firewall` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--exclude_firewall))
- `external_network_id` (String)
-- `hypervisor` (String)
-- `hypervisor_display_name` (String)
- `id` (String)
-- `labels` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--labels))
-- `live_migration_target_hv` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--status))
-- `unique_identifier` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.bindings`
-
-Read-Only:
-
-- `address_detection` (Boolean)
-- `created_at` (String)
-- `id` (String)
-- `logical_port_addresses` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--bindings--logical_port_addresses))
-- `port_security` (Boolean)
-- `segment_display_name` (String)
-- `segment_id` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.bindings.logical_port_addresses`
-
-Read-Only:
-
-- `assigned_at` (String)
-- `id` (String)
-- `ip` (String)
-- `ip_type` (String)
-- `is_discovered` (Boolean)
-- `is_primary` (Boolean)
-- `logical_port_id` (String)
+- `ipv4` (String)
- `mac` (String)
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.exclude_firewall`
-
-Read-Only:
-
-- `exclusion_reason` (String)
-- `logical_port_addresses_excluded` (Boolean)
-- `logical_port_excluded` (Boolean)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.labels`
-
-Read-Only:
-
-- `vm_id` (String)
-- `vm_name` (String)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `gateaway_ports` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports))
-- `id` (String)
-- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--policies))
-- `ports` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports))
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--status))
-- `updated_at` (String)
- `version_id` (Number)
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.gateaway_ports`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `external_l4_port_max` (Number)
-- `external_l4_port_min` (Number)
-- `id` (String)
-- `snat_enabled` (Boolean)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports--status))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.gateaway_ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.gateaway_ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.policies`
-
-Read-Only:
-
-- `action` (String)
-- `created_at` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `match` (String)
-- `next_ipv4_address` (List of String)
-- `next_ipv6_address` (List of String)
-- `priority` (Number)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `ipv4_address` (String)
-- `ipv6_address` (String)
-- `ipv6_config` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--ipv6_config))
-- `mac` (String)
-- `segment` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--segment))
-- `segment_id` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--status))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.ipv6_config`
-
-Read-Only:
-
-- `address_mode` (String)
-- `enable_periodic_ra` (Boolean)
-- `interval_ra` (Number)
-- `router_preference` (String)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.segment`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `subnet_v4` (String)
-- `subnet_v6` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.ipv6_config`
-
-Read-Only:
-
-- `address_mode` (String)
-- `enable_periodic_ra` (Boolean)
-- `interval_ra` (Number)
-- `router_preference` (String)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.router_gateaway_port`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `id` (String)
-- `router_display_name` (String)
-- `router_id` (String)
-- `snat_enabled` (Boolean)
-- `updated_at` (String)
-
-
-
-
-### Nested Schema for `external_network_ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
### Nested Schema for `l2_connection_ports`
diff --git a/docs/data-sources/sdn_network_object_group_list.md b/docs/data-sources/sdn_network_object_group_list.md
index a0b0a83d..62078fcd 100644
--- a/docs/data-sources/sdn_network_object_group_list.md
+++ b/docs/data-sources/sdn_network_object_group_list.md
@@ -26,6 +26,7 @@ description: |-
- `sort_by` (String)
- `sort_order` (String)
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+- `type` (String)
- `updated_from` (String)
- `updated_to` (String)
@@ -96,374 +97,17 @@ Read-Only:
Read-Only:
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `bridge_network_name` (String)
-- `comment` (String)
-- `created_at` (String)
-- `default_gateway_ipv4` (String)
-- `default_gateway_ipv6` (String)
-- `description` (String)
-- `enabled` (Boolean)
-- `external_network_ports` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports))
-- `hypervisors` (List of String)
-- `id` (String)
-- `ipv4` (String)
-- `mac` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--status))
-- `subnet_v4` (String)
-- `subnet_v6` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-- `vlan_tag` (Number)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports`
-
-Read-Only:
-
- `access_group_id` (String)
- `access_group_name` (String)
- `comment` (String)
- `display_name` (String)
- `enabled` (Boolean)
-- `floating_ip` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip))
-- `ipv4` (String)
-- `ipv6` (String)
-- `ipv6_config` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--ipv6_config))
-- `mac` (String)
-- `router_gateaway_port` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--router_gateaway_port))
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `logical_port` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--logical_port))
-- `router` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.logical_port`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `adapter_mac` (String)
-- `address_detection` (Boolean)
-- `bindings` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--logical_port--bindings))
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `exclude_firewall` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--logical_port--exclude_firewall))
- `external_network_id` (String)
-- `hypervisor` (String)
-- `hypervisor_display_name` (String)
- `id` (String)
-- `labels` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--logical_port--labels))
-- `live_migration_target_hv` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--logical_port--status))
-- `unique_identifier` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.logical_port.bindings`
-
-Read-Only:
-
-- `address_detection` (Boolean)
-- `created_at` (String)
-- `id` (String)
-- `logical_port_addresses` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--logical_port--bindings--logical_port_addresses))
-- `port_security` (Boolean)
-- `segment_display_name` (String)
-- `segment_id` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.logical_port.bindings.logical_port_addresses`
-
-Read-Only:
-
-- `assigned_at` (String)
-- `id` (String)
-- `ip` (String)
-- `ip_type` (String)
-- `is_discovered` (Boolean)
-- `is_primary` (Boolean)
-- `logical_port_id` (String)
+- `ipv4` (String)
- `mac` (String)
-
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.logical_port.exclude_firewall`
-
-Read-Only:
-
-- `exclusion_reason` (String)
-- `logical_port_addresses_excluded` (Boolean)
-- `logical_port_excluded` (Boolean)
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.logical_port.labels`
-
-Read-Only:
-
-- `vm_id` (String)
-- `vm_name` (String)
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.logical_port.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--logical_port--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.logical_port.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `gateaway_ports` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports))
-- `id` (String)
-- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--policies))
-- `ports` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--ports))
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--status))
-- `updated_at` (String)
- `version_id` (Number)
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.gateaway_ports`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `external_l4_port_max` (Number)
-- `external_l4_port_min` (Number)
-- `id` (String)
-- `snat_enabled` (Boolean)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports--status))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.gateaway_ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.gateaway_ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.policies`
-
-Read-Only:
-
-- `action` (String)
-- `created_at` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `match` (String)
-- `next_ipv4_address` (List of String)
-- `next_ipv6_address` (List of String)
-- `priority` (Number)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.ports`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `ipv4_address` (String)
-- `ipv6_address` (String)
-- `ipv6_config` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--ports--ipv6_config))
-- `mac` (String)
-- `segment` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--ports--segment))
-- `segment_id` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--ports--status))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.ports.ipv6_config`
-
-Read-Only:
-
-- `address_mode` (String)
-- `enable_periodic_ra` (Boolean)
-- `interval_ra` (Number)
-- `router_preference` (String)
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.ports.segment`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `subnet_v4` (String)
-- `subnet_v6` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--external_network_ports--floating_ip--router--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.floating_ip.router.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.ipv6_config`
-
-Read-Only:
-
-- `address_mode` (String)
-- `enable_periodic_ra` (Boolean)
-- `interval_ra` (Number)
-- `router_preference` (String)
-
-
-
-### Nested Schema for `items.external_network_ports.external_network_ports.router_gateaway_port`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `id` (String)
-- `router_display_name` (String)
-- `router_id` (String)
-- `snat_enabled` (Boolean)
-- `updated_at` (String)
-
-
-
-
-### Nested Schema for `items.external_network_ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--items--external_network_ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `items.external_network_ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
### Nested Schema for `items.l2_connection_ports`
diff --git a/docs/data-sources/vins.md b/docs/data-sources/vins.md
index 3c1bd87c..4b51fbc3 100644
--- a/docs/data-sources/vins.md
+++ b/docs/data-sources/vins.md
@@ -35,6 +35,7 @@ description: |-
- `deleted_by` (String)
- `deleted_time` (Number)
- `desc` (String) User-defined text description of this ViNS.
+- `enable_default_gateway` (Boolean)
- `gid` (Number)
- `guid` (Number)
- `id` (String) The ID of this resource.
diff --git a/docs/data-sources/zone.md b/docs/data-sources/zone.md
index 9413e542..d5c688f0 100644
--- a/docs/data-sources/zone.md
+++ b/docs/data-sources/zone.md
@@ -31,6 +31,7 @@ description: |-
- `broadcast_addr` (String)
- `bservice_ids` (List of Number)
- `compute_ids` (List of Number)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedatt--cpu_alignment_profiles))
- `created_time` (Number)
- `decort_url` (String)
- `deletable` (Boolean)
@@ -48,6 +49,8 @@ description: |-
- `name` (String)
- `node_ids` (List of Number)
- `ping_addr` (String)
+- `reserved_cpu` (Number)
+- `reserved_ram` (Number)
- `ssl_skip_verify` (Boolean)
- `sso_type` (String)
- `sso_url` (String)
@@ -62,3 +65,13 @@ Optional:
- `default` (String)
- `read` (String)
+
+
+
+### Nested Schema for `cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
diff --git a/docs/data-sources/zone_list.md b/docs/data-sources/zone_list.md
index 99f8d5ec..3545dac9 100644
--- a/docs/data-sources/zone_list.md
+++ b/docs/data-sources/zone_list.md
@@ -52,6 +52,7 @@ Read-Only:
- `app_id` (String)
- `auto_start` (Boolean)
- `broadcast_addr` (String)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedobjatt--items--cpu_alignment_profiles))
- `created_time` (Number)
- `decort_url` (String)
- `deletable` (Boolean)
@@ -65,9 +66,20 @@ Read-Only:
- `name` (String)
- `node_ids` (List of Number)
- `ping_addr` (String)
+- `reserved_cpu` (Number)
+- `reserved_ram` (Number)
- `ssl_skip_verify` (Boolean)
- `sso_type` (String)
- `sso_url` (String)
- `status` (String)
- `updated_time` (Number)
- `zone_id` (Number)
+
+
+### Nested Schema for `items.cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
diff --git a/docs/index.md b/docs/index.md
index 32e95b90..4df9c205 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -17,6 +17,7 @@ description: |-
### Required
- `authenticator` (String) Authentication mode to use when connecting to DECORT cloud API. Should be one of 'decs3o', 'legacy', 'jwt' or 'bvs'.
+- `controller_url` (String) URL of DECORT Cloud controller to use. API calls will be directed to this URL.
### Optional
@@ -25,7 +26,6 @@ description: |-
- `app_secret` (String) Application secret to access DECORT cloud API in 'decs3o' and 'bvs' authentication mode.
- `bvs_password` (String) User password for DECORT cloud API operations in 'bvs' authentication mode.
- `bvs_user` (String) User name for DECORT cloud API operations in 'bvs' authentication mode.
-- `controller_url` (String) URL of DECORT Cloud controller to use. API calls will be directed to this URL.
- `domain` (String) User password for DECORT cloud API operations in 'bvs' authentication mode.
- `jwt` (String) JWT to access DECORT cloud API in 'jwt' authentication mode.
- `oauth2_url` (String) OAuth2 application URL in 'decs3o' and 'bvs' authentication mode.
diff --git a/docs/resources/account.md b/docs/resources/account.md
index c5da744b..f99fdd5b 100644
--- a/docs/resources/account.md
+++ b/docs/resources/account.md
@@ -24,8 +24,8 @@ description: |-
- `default_zone_id` (Number) email
- `desc` (String) description
- `emailaddress` (String) email
-- `enable` (Boolean) enable/disable account
-- `permanently` (Boolean) whether to completely delete the account
+- `enable` (Boolean, Deprecated) enable/disable account
+- `permanently` (Boolean, Deprecated) whether to completely delete the account
- `resource_limits` (Block List, Max: 1) (see [below for nested schema](#nestedblock--resource_limits))
- `restore` (Boolean) restore a deleted account
- `send_access_emails` (Boolean) if true send emails when a user is granted access to resources
diff --git a/docs/resources/cb_cdrom_image.md b/docs/resources/cb_cdrom_image.md
index 97e34348..060b39ee 100644
--- a/docs/resources/cb_cdrom_image.md
+++ b/docs/resources/cb_cdrom_image.md
@@ -26,7 +26,7 @@ description: |-
- `account_id` (Number) AccountId to make the image exclusive
- `architecture` (String) binary architecture of this image, one of X86_64
- `bootable` (Boolean) Does this image boot OS
-- `computeci_id` (Number)
+- `computeci_id` (Number, Deprecated)
- `enabled` (Boolean)
- `hot_resize` (Boolean) Does this machine supports hot resize
- `password_dl` (String) password for upload binary media
diff --git a/docs/resources/cb_disk.md b/docs/resources/cb_disk.md
index d557e3d1..2d323743 100644
--- a/docs/resources/cb_disk.md
+++ b/docs/resources/cb_disk.md
@@ -24,11 +24,11 @@ description: |-
### Optional
-- `blk_discard` (Boolean)
- `block_size` (String)
- `cache` (String) Cache mode for the disk
- `desc` (String)
- `detach` (Boolean) detach disk from machine first
+- `discard` (String)
- `iotune` (Block List, Max: 1) (see [below for nested schema](#nestedblock--iotune))
- `node_ids` (Set of Number)
- `permanently` (Boolean) whether to completely delete the disk, works only with non attached disks
@@ -44,6 +44,7 @@ description: |-
- `acl` (String)
- `boot_partition` (Number)
- `computes` (List of Object) (see [below for nested schema](#nestedatt--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedatt--computes_read_only))
- `created_by` (String)
- `created_time` (Number)
- `deleted_by` (String)
@@ -129,6 +130,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `replication`
@@ -149,6 +159,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `reference_id` (String)
- `res_id` (String)
- `snap_set_guid` (String)
diff --git a/docs/resources/cb_extnet.md b/docs/resources/cb_extnet.md
index 332c9516..2c8ace0f 100644
--- a/docs/resources/cb_extnet.md
+++ b/docs/resources/cb_extnet.md
@@ -17,38 +17,38 @@ description: |-
### Required
-- `gid` (Number) Grid (platform) ID
+- `gid` (Number) Grid platform ID
- `ipcidr` (String) IP network CIDR
- `name` (String) External network name
- `vlan_id` (Number) VLAN ID
### Optional
-- `check_ips` (List of String) IPs to check network availability
+- `check_ips` (List of String) IPs checking network availability
- `default_qos` (Block List, Max: 1) (see [below for nested schema](#nestedblock--default_qos))
- `desc` (String) Optional description
- `dns` (List of String) List of DNS addresses
-- `enable` (Boolean) Disable/Enable extnet
-- `enable_secgroups` (Boolean) enable security groups
-- `end_ip` (String) End of IP range to be explicitly included
-- `excluded_ips` (Set of String) IPs to exclude in current extnet pool
-- `excluded_ips_range` (Block Set) Range of IPs to exclude in current extnet pool (see [below for nested schema](#nestedblock--excluded_ips_range))
+- `enable` (Boolean) Toggle extnet status
+- `enable_secgroups` (Boolean) Enable security groups
+- `end_ip` (String) Explicitly included IP range end
+- `excluded_ips` (Set of String) IPs excluded extnet pool
+- `excluded_ips_range` (Block Set) Range of IPs excluded extnet pool (see [below for nested schema](#nestedblock--excluded_ips_range))
- `gateway` (String) External network gateway IP address
- `highly_available` (Boolean)
- `migrate` (Number)
- `mtu` (Number)
- `ntp` (List of String) List of NTP addresses
-- `ovs_bridge` (String) OpenvSwith bridge name for ExtNet connection
-- `pre_reservations_num` (Number) Number of pre created reservations
+- `ovs_bridge` (String) OpenvSwitch bridge name ExtNet connection
+- `pre_reservations_num` (Number) Number of pre-created reservations
- `reserved_ip` (Block Set) (see [below for nested schema](#nestedblock--reserved_ip))
-- `restart` (Boolean) restart extnet vnf device
+- `restart` (Boolean) Restart extnet vnf device
- `sec_vnfdev_ip` (String)
-- `set_default` (Boolean) Set current extnet as default (can not be undone)
+- `set_default` (Boolean) Set current extnet as default permanent action
- `shared_with` (Set of Number)
-- `start_ip` (String) Start of IP range to be explicitly included
+- `start_ip` (String) Explicitly included IP range start
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
-- `virtual` (Boolean) If true - platform DHCP server will not be created
-- `vnfdev_ip` (String) IP to create VNFDev with
+- `virtual` (Boolean) True disables platform DHCP server creation
+- `vnfdev_ip` (String) VNFDev creation IP
- `zone_id` (Number)
### Read-Only
@@ -60,7 +60,7 @@ description: |-
- `free_ips` (Number)
- `guid` (Number)
- `id` (String) The ID of this resource.
-- `meta` (List of String) meta
+- `meta` (List of String) Meta information
- `milestones` (Number)
- `network` (String)
- `network_ids` (List of Object) (see [below for nested schema](#nestedatt--network_ids))
diff --git a/docs/resources/cb_image.md b/docs/resources/cb_image.md
index db5a07b8..e78b9450 100644
--- a/docs/resources/cb_image.md
+++ b/docs/resources/cb_image.md
@@ -27,7 +27,7 @@ description: |-
- `account_id` (Number) AccountId to make the image exclusive
- `bootable` (Boolean) Does this image boot OS
-- `computeci_id` (Number)
+- `computeci_id` (Number, Deprecated)
- `enabled` (Boolean)
- `hot_resize` (Boolean) Does this machine supports hot resize
- `network_interface_naming` (String) select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming
diff --git a/docs/resources/cb_image_from_blank_compute.md b/docs/resources/cb_image_from_blank_compute.md
index f28f3dfb..dcc4eb58 100644
--- a/docs/resources/cb_image_from_blank_compute.md
+++ b/docs/resources/cb_image_from_blank_compute.md
@@ -28,7 +28,7 @@ description: |-
- `account_id` (Number) AccountId to make the image exclusive
- `async_mode` (Boolean) create an image in async/sync mode
- `bootable` (Boolean) Does this image boot OS
-- `computeci_id` (Number)
+- `computeci_id` (Number, Deprecated)
- `enabled` (Boolean)
- `hot_resize` (Boolean) Does this machine supports hot resize
- `network_interface_naming` (String) select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming
diff --git a/docs/resources/cb_image_from_platform_disk.md b/docs/resources/cb_image_from_platform_disk.md
index 666de83d..10578c08 100644
--- a/docs/resources/cb_image_from_platform_disk.md
+++ b/docs/resources/cb_image_from_platform_disk.md
@@ -27,7 +27,7 @@ description: |-
- `account_id` (Number) AccountId to make the image exclusive
- `async_mode` (Boolean) create an image in async/sync mode
- `bootable` (Boolean) Does this image boot OS
-- `computeci_id` (Number)
+- `computeci_id` (Number, Deprecated)
- `enabled` (Boolean)
- `hot_resize` (Boolean) Does this machine supports hot resize
- `network_interface_naming` (String) select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming
diff --git a/docs/resources/cb_k8s_cp.md b/docs/resources/cb_k8s_cp.md
index abf8faea..363e6d8e 100644
--- a/docs/resources/cb_k8s_cp.md
+++ b/docs/resources/cb_k8s_cp.md
@@ -17,7 +17,7 @@ description: |-
### Required
-- `k8sci_id` (Number) ID of the k8s catalog item to base this instance on.
+- `k8sci_id` (Number) ID of the k8s catalog item to base this instance on. The maximum supported Kubernetes version is < 1.29.
- `name` (String) Name of the cluster.
- `network_plugin` (String) Network plugin to be used
- `rg_id` (Number) Resource group ID that this instance belongs to.
diff --git a/docs/resources/cb_kvmvm.md b/docs/resources/cb_kvmvm.md
index f48e95d7..a90d378c 100644
--- a/docs/resources/cb_kvmvm.md
+++ b/docs/resources/cb_kvmvm.md
@@ -30,13 +30,15 @@ description: |-
- `alt_boot_id` (Number) ID of CD-ROM live image to boot
- `anti_affinity_rules` (Block List) (see [below for nested schema](#nestedblock--anti_affinity_rules))
- `auto_start_w_node` (Boolean)
-- `boot_disk_blk_discard` (Boolean)
- `boot_disk_cache` (String) Setting the boot disk caching mode
+- `boot_disk_discard` (String)
- `boot_disk_size` (Number) This compute instance boot disk size in GB. Make sure it is large enough to accomodate selected OS image.
- `boot_type` (String) Type of image upload.
- `cd` (Block Set, Max: 1) (see [below for nested schema](#nestedblock--cd))
- `chipset` (String) Type of the emulated system.
+- `clock` (String) Clock synchronization mode.
- `cloud_init` (String) Optional cloud_init parameters. Applied when creating new compute instance only, ignored in all other cases.
+- `cpu_alignment_profile` (String) CPU alignment profile name
- `cpu_pin` (Boolean) Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node.
- `create_blank` (Boolean) If True, the compute is created via kvmx86/createBlank endpoint (without OS image). The image_id field is not required in this case.
- `custom_fields` (String)
@@ -127,6 +129,7 @@ description: |-
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_name` (String) Name of the resource group where this compute instance is located.
- `snap_sets` (List of Object) (see [below for nested schema](#nestedatt--snap_sets))
- `stateless_sep_id` (Number)
@@ -184,15 +187,16 @@ Required:
Optional:
-- `blk_discard` (Boolean)
- `block_size` (String) Disk block size
- `cache` (String) Setting the disk caching mode
- `desc` (String) Optional description
+- `discard` (String)
- `image_id` (Number) Specify image id for create disk from template
- `iotune` (Block List, Max: 1) (see [below for nested schema](#nestedblock--disks--iotune))
- `node_ids` (Set of Number)
- `permanently` (Boolean) Disk deletion status
- `pool` (String) Pool name; by default will be chosen automatically
+- `read_only` (Boolean) Mount disk in read-only mode
- `sep_id` (Number) Storage endpoint provider ID; by default the same with boot disk
Read-Only:
@@ -263,6 +267,7 @@ Required:
Optional:
+- `enable_default_gateway` (Boolean) Flag indicating whether default gateway is enabled for this interface. Applicable only to VINS network type
- `enabled` (Boolean) network enable flag
- `ip_address` (String) Optional IP address to assign to this connection. This IP should belong to the selected network and free for use.
- `mac` (String) MAC address associated with this connection. MAC address is assigned automatically.
@@ -372,6 +377,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -449,6 +455,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/resources/cb_multi_image.md b/docs/resources/cb_multi_image.md
index 78dded85..a5e68fea 100644
--- a/docs/resources/cb_multi_image.md
+++ b/docs/resources/cb_multi_image.md
@@ -24,7 +24,7 @@ description: |-
- `account_id` (Number) Account id to make the image exclusive
- `bootable` (Boolean) Does this image boot OS
-- `computeci_id` (Number)
+- `computeci_id` (Number, Deprecated)
- `enabled` (Boolean)
- `hot_resize` (Boolean) Does this machine supports hot resize
- `password` (String) Optional password for the image
diff --git a/docs/resources/cb_rg.md b/docs/resources/cb_rg.md
index 172b8a1a..dbc032de 100644
--- a/docs/resources/cb_rg.md
+++ b/docs/resources/cb_rg.md
@@ -31,6 +31,7 @@ description: |-
- `def_net_type` (String) Type of the network, which this resource group will use as default for its computes - PRIVATE or PUBLIC or NONE.
- `description` (String) User-defined text description of this resource group.
- `enable` (Boolean) enable/disable rg
+- `enable_default_gateway` (Boolean)
- `ext_ip` (String) IP address on the external netowrk to request when def_net_type=PRIVATE and ext_net_id is not 0
- `ext_net_id` (Number) ID of the external network for default ViNS. Pass 0 if def_net_type=PUBLIC or no external connection required for the defult ViNS when def_net_type=PRIVATE
- `force` (Boolean) flag to force deleting resource group
diff --git a/docs/resources/cb_sep.md b/docs/resources/cb_sep.md
index cd5f86c3..b866b9d8 100644
--- a/docs/resources/cb_sep.md
+++ b/docs/resources/cb_sep.md
@@ -24,8 +24,8 @@ description: |-
### Optional
-- `access_to_pool` (Block Set, Max: 1) grant or revoke access to pool (see [below for nested schema](#nestedblock--access_to_pool))
-- `account_ids` (Set of Number) lift of account ids to have access to sep
+- `access_to_pool` (Block Set, Max: 1, Deprecated) grant or revoke access to pool (see [below for nested schema](#nestedblock--access_to_pool))
+- `account_ids` (Set of Number, Deprecated) lift of account ids to have access to sep
- `consumed_by` (Set of Number) list of consumer nodes IDs
- `desc` (String) sep description
- `enable` (Boolean) enable SEP after creation
diff --git a/docs/resources/cb_user.md b/docs/resources/cb_user.md
index 6ea73466..584d0ea7 100644
--- a/docs/resources/cb_user.md
+++ b/docs/resources/cb_user.md
@@ -18,13 +18,13 @@ description: |-
### Required
- `emailaddress` (String) email address of the user
+- `password` (String, Sensitive) password of user
- `username` (String) ID of user
### Optional
- `apiaccess` (Set of Number) list of apiaccess groups this user belongs to
- `blocked` (Boolean) is the user blocked
-- `password` (String) password of user
- `provider_name` (String) provider
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
diff --git a/docs/resources/cb_vins.md b/docs/resources/cb_vins.md
index def08bee..51335243 100644
--- a/docs/resources/cb_vins.md
+++ b/docs/resources/cb_vins.md
@@ -26,6 +26,7 @@ description: |-
- `description` (String) Optional user-defined text description of this ViNS.
- `dns` (Set of String)
- `enable` (Boolean) enable for enable/disable requests
+- `enable_default_gateway` (Boolean) Flag indicating whether default gateway is enabled for this VINS
- `enable_secgroups` (Boolean) enable security groups
- `ext_ip` (String)
- `ext_net_id` (Number)
diff --git a/docs/resources/cb_virtual_image.md b/docs/resources/cb_virtual_image.md
index 75f5e637..a6cd72f6 100644
--- a/docs/resources/cb_virtual_image.md
+++ b/docs/resources/cb_virtual_image.md
@@ -24,7 +24,7 @@ description: |-
- `account_id` (Number) AccountId to make the image exclusive
- `bootable` (Boolean) Does this image boot OS
-- `computeci_id` (Number)
+- `computeci_id` (Number, Deprecated)
- `enabled` (Boolean)
- `hot_resize` (Boolean) Does this machine supports hot resize
- `password` (String) Optional password for the image
diff --git a/docs/resources/cb_zone.md b/docs/resources/cb_zone.md
index cbef45f7..a1cdc80f 100644
--- a/docs/resources/cb_zone.md
+++ b/docs/resources/cb_zone.md
@@ -24,13 +24,17 @@ description: |-
- `auto_start` (Boolean)
- `description` (String)
- `drs` (Boolean)
+- `hypervisor_similarity_in_percentage` (Number)
- `node_ids` (List of Number)
+- `reserved_cpu` (Number)
+- `reserved_ram` (Number)
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
### Read-Only
- `app_id` (String)
- `broadcast_addr` (String)
+- `cpu_alignment_profiles` (List of Object) (see [below for nested schema](#nestedatt--cpu_alignment_profiles))
- `created_time` (Number)
- `decort_url` (String)
- `deletable` (Boolean)
@@ -58,3 +62,13 @@ Optional:
- `delete` (String)
- `read` (String)
- `update` (String)
+
+
+
+### Nested Schema for `cpu_alignment_profiles`
+
+Read-Only:
+
+- `model` (String)
+- `name` (String)
+- `vendor` (String)
diff --git a/docs/resources/disk.md b/docs/resources/disk.md
index e270e66f..a5fb0cca 100644
--- a/docs/resources/disk.md
+++ b/docs/resources/disk.md
@@ -37,16 +37,17 @@ description: |-
- `account_name` (String) The name of the subscriber '(account') to whom this disk belongs
- `acl` (String)
-- `blk_discard` (Boolean) Flag indicating whether blk-discard is enabled for the disk
- `block_size` (String)
- `cache` (String)
- `computes` (List of Object) (see [below for nested schema](#nestedatt--computes))
+- `computes_read_only` (List of Object) (see [below for nested schema](#nestedatt--computes_read_only))
- `created_by` (String)
- `created_time` (Number) Created time
- `deleted_by` (String)
- `deleted_time` (Number) Deleted time
- `destruction_time` (Number) Time of final deletion
- `devicename` (String) Name of the device
+- `discard` (String) Discard mode of the disk
- `disk_id` (Number) Disk ID. Duplicates the value of the ID parameter
- `gid` (Number) ID of the grid (platform)
- `id` (String) The ID of this resource.
@@ -117,6 +118,15 @@ Read-Only:
- `compute_name` (String)
+
+### Nested Schema for `computes_read_only`
+
+Read-Only:
+
+- `compute_id` (String)
+- `read_only` (Boolean)
+
+
### Nested Schema for `replication`
@@ -137,6 +147,7 @@ Read-Only:
- `guid` (String)
- `label` (String)
+- `pool_name` (String)
- `res_id` (String)
- `snap_set_guid` (String)
- `snap_set_time` (Number)
diff --git a/docs/resources/image_virtual.md b/docs/resources/image_virtual.md
index e29ce402..a4e77f87 100644
--- a/docs/resources/image_virtual.md
+++ b/docs/resources/image_virtual.md
@@ -17,12 +17,12 @@ description: |-
### Required
+- `account_id` (Number) Account ID
- `link_to` (Number) ID of real image to link this virtual image to upon creation
- `name` (String) Name of the rescue disk
### Optional
-- `account_id` (Number) account_id
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
### Read-Only
diff --git a/docs/resources/k8s.md b/docs/resources/k8s.md
index bc0d595e..eb398369 100644
--- a/docs/resources/k8s.md
+++ b/docs/resources/k8s.md
@@ -17,7 +17,7 @@ description: |-
### Required
-- `k8sci_id` (Number) ID of the k8s catalog item to base this instance on.
+- `k8sci_id` (Number) ID of the k8s catalog item to base this instance on. The maximum supported Kubernetes version is < 1.29.
- `name` (String) Name of the cluster.
- `network_plugin` (String) Network plugin to be used
- `rg_id` (Number) Resource group ID that this instance belongs to.
diff --git a/docs/resources/k8s_cp.md b/docs/resources/k8s_cp.md
index 95710bb8..4d95f15a 100644
--- a/docs/resources/k8s_cp.md
+++ b/docs/resources/k8s_cp.md
@@ -17,7 +17,7 @@ description: |-
### Required
-- `k8sci_id` (Number) ID of the k8s catalog item to base this instance on.
+- `k8sci_id` (Number) ID of the k8s catalog item to base this instance on. The maximum supported Kubernetes version is < 1.29.
- `name` (String) Name of the cluster.
- `network_plugin` (String) Network plugin to be used
- `rg_id` (Number) Resource group ID that this instance belongs to.
diff --git a/docs/resources/kvmvm.md b/docs/resources/kvmvm.md
index e78187fa..6afc8289 100644
--- a/docs/resources/kvmvm.md
+++ b/docs/resources/kvmvm.md
@@ -34,7 +34,9 @@ description: |-
- `boot_type` (String) Type of image upload.
- `cd` (Block Set, Max: 1) (see [below for nested schema](#nestedblock--cd))
- `chipset` (String) Type of the emulated system.
+- `clock` (String) Clock synchronization mode.
- `cloud_init` (String) Optional cloud_init parameters. Applied when creating new compute instance only, ignored in all other cases.
+- `cpu_alignment_profile` (String) CPU alignment profile name
- `cpu_pin` (Boolean) Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node.
- `create_blank` (Boolean) If True, the compute is created via kvmx86/createBlank endpoint (without OS image). The image_id field is not required in this case.
- `custom_fields` (String)
@@ -119,6 +121,7 @@ description: |-
- `registered` (Boolean)
- `res_name` (String)
- `reserved_node_cpus` (List of Number)
+- `resized_online` (Boolean)
- `rg_name` (String) Name of the resource group where this compute instance is located.
- `snap_sets` (List of Object) (see [below for nested schema](#nestedatt--snap_sets))
- `stateless_sep_id` (Number)
@@ -182,11 +185,11 @@ Optional:
- `iotune` (Block List, Max: 1) (see [below for nested schema](#nestedblock--disks--iotune))
- `permanently` (Boolean) Disk deletion status
- `pool` (String) Pool name; by default will be chosen automatically
+- `read_only` (Boolean) Mount disk in read-only mode
- `sep_id` (Number) Storage endpoint provider ID; by default the same with boot disk
Read-Only:
-- `blk_discard` (Boolean)
- `block_size` (String)
- `bus_number` (Number) Bus number of the disk on virtual bus (6 = boot disk)
- `cache` (String)
@@ -195,6 +198,7 @@ Read-Only:
- `deleted_by` (String)
- `deleted_time` (Number)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number) Disk ID
- `independent` (Boolean)
- `pci_slot` (Number) PCI slot number of the disk
@@ -237,6 +241,7 @@ Required:
Optional:
+- `enable_default_gateway` (Boolean) Flag indicating whether default gateway is enabled for this interface. Applicable only to VINS network type
- `enabled` (Boolean) network enable flag
- `ip_address` (String) Optional IP address to assign to this connection. This IP should belong to the selected network and free for use.
- `mac` (String) MAC address associated with this connection. MAC address is assigned automatically.
@@ -325,7 +330,6 @@ Required:
Read-Only:
-- `blk_discard` (Boolean)
- `block_size` (String)
- `bus_number` (Number)
- `cache` (String)
@@ -335,6 +339,7 @@ Read-Only:
- `deleted_time` (Number)
- `desc` (String)
- `devicename` (String)
+- `discard` (String)
- `disk_id` (Number)
- `disk_name` (String)
- `image_id` (Number)
@@ -345,6 +350,7 @@ Read-Only:
- `pool` (String)
- `present_to` (Map of Number)
- `provision` (String)
+- `read_only` (Boolean)
- `sep_id` (Number)
- `shareable` (Boolean)
- `size` (Number)
@@ -384,6 +390,7 @@ Read-Only:
- `conn_id` (Number)
- `conn_type` (String)
- `def_gw` (String)
+- `enable_default_gateway` (Boolean)
- `enable_secgroups` (Boolean)
- `enabled` (Boolean)
- `flip_group_id` (Number)
@@ -461,6 +468,7 @@ Read-Only:
- `disks` (List of Number)
- `guid` (String)
- `label` (String)
+- `memory_dump_image` (Number)
- `timestamp` (Number)
diff --git a/docs/resources/resgroup.md b/docs/resources/resgroup.md
index 57371bab..1d7a9bda 100644
--- a/docs/resources/resgroup.md
+++ b/docs/resources/resgroup.md
@@ -28,6 +28,7 @@ description: |-
- `def_net_type` (String) Type of the network, which this resource group will use as default for its computes - PRIVATE or PUBLIC or NONE.
- `description` (String) User-defined text description of this resource group.
- `enable` (Boolean) flag for enable/disable RG
+- `enable_default_gateway` (Boolean)
- `ext_ip` (String) IP address on the external netowrk to request when def_net_type=PRIVATE and ext_net_id is not 0
- `ext_net_id` (Number) ID of the external network for default ViNS. Pass 0 if def_net_type=PUBLIC or no external connection required for the defult ViNS when def_net_type=PRIVATE
- `force` (Boolean) Set to True if you want force delete non-empty RG
diff --git a/docs/resources/sdn_logical_port.md b/docs/resources/sdn_logical_port.md
index 964edfcc..2bcbc803 100644
--- a/docs/resources/sdn_logical_port.md
+++ b/docs/resources/sdn_logical_port.md
@@ -47,7 +47,6 @@ description: |-
- `id` (String) ID of the logical port
- `live_migration_target_hv` (String)
- `status` (List of Object) (see [below for nested schema](#nestedatt--status))
-- `updated_at` (String) Last update time of the logical port
- `version_id` (Number) Version ID of the logical port
diff --git a/docs/resources/sdn_network_object_group.md b/docs/resources/sdn_network_object_group.md
index bfe89a00..cb9a71e9 100644
--- a/docs/resources/sdn_network_object_group.md
+++ b/docs/resources/sdn_network_object_group.md
@@ -97,374 +97,17 @@ Read-Only:
Read-Only:
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `bridge_network_name` (String)
-- `comment` (String)
-- `created_at` (String)
-- `default_gateway_ipv4` (String)
-- `default_gateway_ipv6` (String)
-- `description` (String)
-- `enabled` (Boolean)
-- `external_network_ports` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports))
-- `hypervisors` (List of String)
-- `id` (String)
-- `ipv4` (String)
-- `mac` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--status))
-- `subnet_v4` (String)
-- `subnet_v6` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-- `vlan_tag` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports`
-
-Read-Only:
-
- `access_group_id` (String)
- `access_group_name` (String)
- `comment` (String)
- `display_name` (String)
- `enabled` (Boolean)
-- `floating_ip` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip))
-- `ipv4` (String)
-- `ipv6` (String)
-- `ipv6_config` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--ipv6_config))
-- `mac` (String)
-- `router_gateaway_port` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--router_gateaway_port))
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `logical_port` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port))
-- `router` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `adapter_mac` (String)
-- `address_detection` (Boolean)
-- `bindings` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--bindings))
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `exclude_firewall` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--exclude_firewall))
- `external_network_id` (String)
-- `hypervisor` (String)
-- `hypervisor_display_name` (String)
- `id` (String)
-- `labels` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--labels))
-- `live_migration_target_hv` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--status))
-- `unique_identifier` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.bindings`
-
-Read-Only:
-
-- `address_detection` (Boolean)
-- `created_at` (String)
-- `id` (String)
-- `logical_port_addresses` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--bindings--logical_port_addresses))
-- `port_security` (Boolean)
-- `segment_display_name` (String)
-- `segment_id` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.bindings.logical_port_addresses`
-
-Read-Only:
-
-- `assigned_at` (String)
-- `id` (String)
-- `ip` (String)
-- `ip_type` (String)
-- `is_discovered` (Boolean)
-- `is_primary` (Boolean)
-- `logical_port_id` (String)
+- `ipv4` (String)
- `mac` (String)
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.exclude_firewall`
-
-Read-Only:
-
-- `exclusion_reason` (String)
-- `logical_port_addresses_excluded` (Boolean)
-- `logical_port_excluded` (Boolean)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.labels`
-
-Read-Only:
-
-- `vm_id` (String)
-- `vm_name` (String)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--logical_port--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.logical_port.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `gateaway_ports` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports))
-- `id` (String)
-- `policies` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--policies))
-- `ports` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports))
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--status))
-- `updated_at` (String)
- `version_id` (Number)
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.gateaway_ports`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `external_l4_port_max` (Number)
-- `external_l4_port_min` (Number)
-- `id` (String)
-- `snat_enabled` (Boolean)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports--status))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.gateaway_ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--gateaway_ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.gateaway_ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.policies`
-
-Read-Only:
-
-- `action` (String)
-- `created_at` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `match` (String)
-- `next_ipv4_address` (List of String)
-- `next_ipv6_address` (List of String)
-- `priority` (Number)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `ipv4_address` (String)
-- `ipv6_address` (String)
-- `ipv6_config` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--ipv6_config))
-- `mac` (String)
-- `segment` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--segment))
-- `segment_id` (String)
-- `status` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--status))
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.ipv6_config`
-
-Read-Only:
-
-- `address_mode` (String)
-- `enable_periodic_ra` (Boolean)
-- `interval_ra` (Number)
-- `router_preference` (String)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.segment`
-
-Read-Only:
-
-- `access_group_id` (String)
-- `access_group_name` (String)
-- `created_at` (String)
-- `description` (String)
-- `display_name` (String)
-- `enabled` (Boolean)
-- `id` (String)
-- `subnet_v4` (String)
-- `subnet_v6` (String)
-- `updated_at` (String)
-- `version_id` (Number)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--external_network_ports--floating_ip--router--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.external_network_ports.floating_ip.router.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.ipv6_config`
-
-Read-Only:
-
-- `address_mode` (String)
-- `enable_periodic_ra` (Boolean)
-- `interval_ra` (Number)
-- `router_preference` (String)
-
-
-
-### Nested Schema for `external_network_ports.external_network_ports.router_gateaway_port`
-
-Read-Only:
-
-- `created_at` (String)
-- `description` (String)
-- `id` (String)
-- `router_display_name` (String)
-- `router_id` (String)
-- `snat_enabled` (Boolean)
-- `updated_at` (String)
-
-
-
-
-### Nested Schema for `external_network_ports.status`
-
-Read-Only:
-
-- `hypervisor_status` (String)
-- `hypervisors` (List of Object) (see [below for nested schema](#nestedobjatt--external_network_ports--status--hypervisors))
-- `operation_status` (String)
-
-
-### Nested Schema for `external_network_ports.status.hypervisors`
-
-Read-Only:
-
-- `display_name` (String)
-- `hypervisor_status` (String)
-- `name` (String)
-- `operation_status` (String)
-- `synced_at` (String)
-
-
-
### Nested Schema for `l2_connection_ports`
diff --git a/docs/resources/vins.md b/docs/resources/vins.md
index bf6bf788..da31d720 100644
--- a/docs/resources/vins.md
+++ b/docs/resources/vins.md
@@ -25,6 +25,7 @@ description: |-
- `desc` (String) Optional user-defined text description of this ViNS.
- `dns` (Set of String)
- `enable` (Boolean)
+- `enable_default_gateway` (Boolean) Flag indicating whether default gateway is enabled for this VINS
- `enable_secgroups` (Boolean) enable security groups
- `ext_ip_addr` (String)
- `ext_net` (Block List, Max: 1) (see [below for nested schema](#nestedblock--ext_net))
diff --git a/go.mod b/go.mod
index e40e9799..94c0d25d 100644
--- a/go.mod
+++ b/go.mod
@@ -9,7 +9,7 @@ require (
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1
github.com/sirupsen/logrus v1.9.0
golang.org/x/net v0.44.0
- repository.basistech.ru/BASIS/decort-golang-sdk v1.14.13
+ repository.basistech.ru/BASIS/decort-golang-sdk v1.15.7
)
require (
diff --git a/go.sum b/go.sum
index 89a63dfd..ea1c03c4 100644
--- a/go.sum
+++ b/go.sum
@@ -318,5 +318,5 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-repository.basistech.ru/BASIS/decort-golang-sdk v1.14.13 h1:kYopwej9i4QORHzCyo8AXdHQplyCBD10771PJFBB+4A=
-repository.basistech.ru/BASIS/decort-golang-sdk v1.14.13/go.mod h1:S/f7GxwWcE88eFpORV+I9xqEf8zDW5srQHpG2XQCLZM=
+repository.basistech.ru/BASIS/decort-golang-sdk v1.15.7 h1:/BCkmR2Dvyz9Cc08I2sPHdLuaCaQbBJWFximQMNpmHE=
+repository.basistech.ru/BASIS/decort-golang-sdk v1.15.7/go.mod h1:S/f7GxwWcE88eFpORV+I9xqEf8zDW5srQHpG2XQCLZM=
diff --git a/internal/provider/data_sources_map.go b/internal/provider/data_sources_map.go
index 8f8b144e..51025e8c 100644
--- a/internal/provider/data_sources_map.go
+++ b/internal/provider/data_sources_map.go
@@ -165,6 +165,7 @@ func newDataSourcesMap() map[string]*schema.Resource {
"decort_kvmvm_list_deleted": kvmvm.DataSourceComputeListDeleted(),
"decort_kvmvm_vgpu_list": kvmvm.DataSourceComputeVGPUList(),
"decort_kvmvm_pci_device_list": kvmvm.DataSourceComputePCIDeviceList(),
+ "decort_kvmvm_cpu_alignment_profile": kvmvm.DataSourceComputeCPUAlignmentProfile(),
"decort_k8s_wg_cloud_init": k8s.DataSourceK8sWgCloudInit(),
"decort_rg_resource_consumption_list": rg.DataSourceRGResourceConsumptionList(),
"decort_rg_resource_consumption_get": rg.DataSourceRGResourceConsumptionGet(),
@@ -229,8 +230,11 @@ func newDataSourcesMap() map[string]*schema.Resource {
"decort_cb_kvmvm_snapshot_usage": cb_kvmvm.DataSourceComputeSnapshotUsage(),
"decort_cb_kvmvm_user_list": cb_kvmvm.DataSourceComputeUserList(),
"decort_cb_kvmvm_vgpu_list": cb_kvmvm.DataSourceComputeVGPUList(),
+ "decort_cb_kvmvm_cpu_alignment_profile": cb_kvmvm.DataSourceComputeCPUAlignmentProfile(),
"decort_cb_node": cb_node.DataSourceNode(),
"decort_cb_node_list": cb_node.DataSourceNodeList(),
+ "decort_cb_node_network_info": cb_node.DataSourceNodeNetworkInfo(),
+ "decort_cb_node_pci_devices": cb_node.DataSourceNodePCIDevices(),
"decort_cb_disk": cb_disks.DataSourceDisk(),
"decort_cb_disk_list": cb_disks.DataSourceDiskList(),
"decort_cb_disk_list_deleted": cb_disks.DataSourceDiskListDeleted(),
@@ -297,8 +301,11 @@ func newDataSourcesMap() map[string]*schema.Resource {
"decort_cb_k8s_wg_cloud_init": cb_k8s.DataSourceK8sWgCloudInit(),
"decort_cb_k8s_wg_list": cb_k8s.DataSourceK8sWgList(),
"decort_cb_k8s_computes": cb_k8s.DataSourceK8sComputes(),
- "decort_cb_zone": cb_zone.DataSourceZone(),
- "decort_cb_zone_list": cb_zone.DataSourceZoneList(),
+ "decort_cb_zone": cb_zone.DataSourceZone(),
+ "decort_cb_zone_list": cb_zone.DataSourceZoneList(),
+ "decort_cb_zone_cpu_alignment_profile": cb_zone.DataSourceZoneCPUAlignmentProfile(),
+ "decort_cb_zone_cpu_alignment_profile_list": cb_zone.DataSourceZoneCPUAlignmentProfileList(),
+ "decort_cb_zone_cpu_alignment_profile_test": cb_zone.DataSourceZoneCPUAlignmentProfileTest(),
"decort_sdn_access_group": accessgroup.DataSourceAccessGroup(),
"decort_sdn_access_group_list": accessgroup.DataSourceAccessGroupList(),
diff --git a/internal/service/cloudapi/account/data_source_account.go b/internal/service/cloudapi/account/data_source_account.go
index 8543493f..edb22147 100644
--- a/internal/service/cloudapi/account/data_source_account.go
+++ b/internal/service/cloudapi/account/data_source_account.go
@@ -349,7 +349,7 @@ func dataSourceAccountSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"storage_policy_ids": {
diff --git a/internal/service/cloudapi/account/data_source_account_audits_list.go b/internal/service/cloudapi/account/data_source_account_audits_list.go
index 21ca7a5b..c6a1c932 100644
--- a/internal/service/cloudapi/account/data_source_account_audits_list.go
+++ b/internal/service/cloudapi/account/data_source_account_audits_list.go
@@ -116,6 +116,8 @@ func DataSourceAccountAuditsList() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_audit_list instead.",
+
ReadContext: dataSourceAccountAuditsListRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudapi/account/data_source_account_consumed_units_by_type.go b/internal/service/cloudapi/account/data_source_account_consumed_units_by_type.go
index 7c246caf..44d4d229 100644
--- a/internal/service/cloudapi/account/data_source_account_consumed_units_by_type.go
+++ b/internal/service/cloudapi/account/data_source_account_consumed_units_by_type.go
@@ -79,6 +79,8 @@ func DataSourceAccountConsumedUnitsByType() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0.",
+
ReadContext: dataSourceAccountConsumedUnitsByTypeRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudapi/account/data_source_account_reserved_units.go b/internal/service/cloudapi/account/data_source_account_reserved_units.go
index 8e2ec66b..5ba71d18 100644
--- a/internal/service/cloudapi/account/data_source_account_reserved_units.go
+++ b/internal/service/cloudapi/account/data_source_account_reserved_units.go
@@ -99,6 +99,8 @@ func DataSourceAccountReservedUnits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0.",
+
ReadContext: dataSourceAccountReservedUnitsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudapi/account/resource_account.go b/internal/service/cloudapi/account/resource_account.go
index 48f5aa6b..347e9f72 100644
--- a/internal/service/cloudapi/account/resource_account.go
+++ b/internal/service/cloudapi/account/resource_account.go
@@ -501,12 +501,14 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Optional: true,
Default: false,
Description: "whether to completely delete the account",
+ Deprecated: "\"permanently\" is deprecated and will be removed in version 4.14.0",
},
"enable": {
Type: schema.TypeBool,
Optional: true,
Computed: true,
Description: "enable/disable account",
+ Deprecated: "\"enable\" is deprecated and will be removed in version 4.14.0",
},
"resource_limits": {
Type: schema.TypeList,
@@ -667,7 +669,7 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"storage_policy_ids": {
diff --git a/internal/service/cloudapi/disks/data_source_disk.go b/internal/service/cloudapi/disks/data_source_disk.go
index 68af2d17..2bc11f9d 100644
--- a/internal/service/cloudapi/disks/data_source_disk.go
+++ b/internal/service/cloudapi/disks/data_source_disk.go
@@ -80,8 +80,8 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -109,6 +109,22 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_by": {
Type: schema.TypeString,
Computed: true,
@@ -431,6 +447,10 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Name of the snapshot",
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"res_id": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudapi/disks/data_source_disk_list.go b/internal/service/cloudapi/disks/data_source_disk_list.go
index ee80f0c8..321af14c 100644
--- a/internal/service/cloudapi/disks/data_source_disk_list.go
+++ b/internal/service/cloudapi/disks/data_source_disk_list.go
@@ -152,8 +152,8 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -181,6 +181,22 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_by": {
Type: schema.TypeString,
Computed: true,
@@ -510,6 +526,10 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Name of the snapshot",
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"res_id": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudapi/disks/data_source_disk_list_unattached.go b/internal/service/cloudapi/disks/data_source_disk_list_unattached.go
index cdc65760..f989b44b 100644
--- a/internal/service/cloudapi/disks/data_source_disk_list_unattached.go
+++ b/internal/service/cloudapi/disks/data_source_disk_list_unattached.go
@@ -155,8 +155,8 @@ func dataSourceDiskListUnattachedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -430,6 +430,10 @@ func dataSourceDiskListUnattachedSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Name of the snapshot",
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"res_id": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudapi/disks/data_source_disk_replication.go b/internal/service/cloudapi/disks/data_source_disk_replication.go
index e0bbd28f..b0e8696a 100644
--- a/internal/service/cloudapi/disks/data_source_disk_replication.go
+++ b/internal/service/cloudapi/disks/data_source_disk_replication.go
@@ -416,6 +416,10 @@ func dataSourceDiskReplicationSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Name of the snapshot",
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"res_id": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudapi/disks/data_source_list_deleted.go b/internal/service/cloudapi/disks/data_source_list_deleted.go
index 680edeb4..22e4f52b 100644
--- a/internal/service/cloudapi/disks/data_source_list_deleted.go
+++ b/internal/service/cloudapi/disks/data_source_list_deleted.go
@@ -123,8 +123,8 @@ func dataSourceDiskDeletedListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -152,6 +152,22 @@ func dataSourceDiskDeletedListSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_by": {
Type: schema.TypeString,
Computed: true,
@@ -481,6 +497,10 @@ func dataSourceDiskDeletedListSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Name of the snapshot",
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"res_id": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudapi/disks/flattens.go b/internal/service/cloudapi/disks/flattens.go
index 3e4a3ed5..9c8b7f91 100644
--- a/internal/service/cloudapi/disks/flattens.go
+++ b/internal/service/cloudapi/disks/flattens.go
@@ -25,7 +25,7 @@ func flattenDiskListUnattached(ul *disks.ListDisksUnattached) []map[string]inter
"account_id": unattachedDisk.AccountID,
"account_name": unattachedDisk.AccountName,
"acl": string(unattachedDiskAcl),
- "blk_discard": unattachedDisk.BLKDiscard,
+ "discard": unattachedDisk.Discard,
"block_size": unattachedDisk.BlockSize,
"boot_partition": unattachedDisk.BootPartition,
"created_time": unattachedDisk.CreatedTime,
@@ -79,10 +79,11 @@ func flattenDisk(d *schema.ResourceData, disk *disks.RecordDisk) {
d.Set("account_id", disk.AccountID)
d.Set("account_name", disk.AccountName)
d.Set("acl", string(diskAcl))
- d.Set("blk_discard", disk.BLKDiscard)
+ d.Set("discard", disk.Discard)
d.Set("block_size", disk.BlockSize)
// d.Set("boot_partition", disk.BootPartition)
d.Set("computes", flattenDiskComputes(disk.Computes))
+ d.Set("computes_read_only", flattenDiskComputesReadOnly(disk.ComputesReadOnly))
d.Set("created_by", disk.CreatedBy)
d.Set("created_time", disk.CreatedTime)
d.Set("deleted_by", disk.DeletedBy)
@@ -206,6 +207,7 @@ func flattenDiskSnapshotList(sl disks.ListSnapshots) []interface{} {
temp := map[string]interface{}{
"guid": snapshot.GUID,
"label": snapshot.Label,
+ "pool_name": snapshot.PoolName,
"res_id": snapshot.ResID,
"snap_set_guid": snapshot.SnapSetGUID,
"snap_set_time": snapshot.SnapSetTime,
@@ -222,56 +224,57 @@ func flattenDiskList(dl *disks.ListDisks) []map[string]interface{} {
for _, disk := range dl.Data {
diskAcl, _ := json.Marshal(disk.ACL)
temp := map[string]interface{}{
- "account_id": disk.AccountID,
- "account_name": disk.AccountName,
- "acl": string(diskAcl),
- "blk_discard": disk.BLKDiscard,
- "block_size": disk.BlockSize,
- "computes": flattenDiskComputes(disk.Computes),
- "created_by": disk.CreatedBy,
- "created_time": disk.CreatedTime,
- "deleted_by": disk.DeletedBy,
- "deleted_time": disk.DeletedTime,
- "desc": disk.Description,
- "destruction_time": disk.DestructionTime,
- "devicename": disk.DeviceName,
- "gid": disk.GID,
- "disk_id": disk.ID,
- "image_id": disk.ImageID,
- "images": disk.Images,
- "independent": disk.Independent,
- "iotune": flattenIOTune(disk.IOTune),
- "machine_id": disk.MachineID,
- "machine_name": disk.MachineName,
- "milestones": disk.Milestones,
- "disk_name": disk.Name,
- "order": disk.Order,
- "params": disk.Params,
- "parent_id": disk.ParentID,
- "pci_slot": disk.PCISlot,
- "pool": disk.Pool,
- "present_to": disk.PresentTo,
- "provision": disk.Provision,
- "purge_time": disk.PurgeTime,
- "replication": flattenDiskReplication(disk.Replication),
- "res_id": disk.ResID,
- "res_name": disk.ResName,
- "role": disk.Role,
- "sep_id": disk.SepID,
- "sep_type": disk.SepType,
- "shareable": disk.Shareable,
- "cache": disk.Cache,
- "size_available": disk.SizeAvailable,
- "size_max": disk.SizeMax,
- "size_used": disk.SizeUsed,
- "snapshots": flattenDiskSnapshotList(disk.Snapshots),
- "status": disk.Status,
- "storage_policy_id": disk.StoragePolicyID,
- "tech_status": disk.TechStatus,
- "vmid": disk.VMID,
- "updated_by": disk.UpdatedBy,
- "updated_time": disk.UpdatedTime,
- "to_clean": disk.ToClean,
+ "account_id": disk.AccountID,
+ "account_name": disk.AccountName,
+ "acl": string(diskAcl),
+ "discard": disk.Discard,
+ "block_size": disk.BlockSize,
+ "computes": flattenDiskComputes(disk.Computes),
+ "computes_read_only": flattenDiskComputesReadOnly(disk.ComputesReadOnly),
+ "created_by": disk.CreatedBy,
+ "created_time": disk.CreatedTime,
+ "deleted_by": disk.DeletedBy,
+ "deleted_time": disk.DeletedTime,
+ "desc": disk.Description,
+ "destruction_time": disk.DestructionTime,
+ "devicename": disk.DeviceName,
+ "gid": disk.GID,
+ "disk_id": disk.ID,
+ "image_id": disk.ImageID,
+ "images": disk.Images,
+ "independent": disk.Independent,
+ "iotune": flattenIOTune(disk.IOTune),
+ "machine_id": disk.MachineID,
+ "machine_name": disk.MachineName,
+ "milestones": disk.Milestones,
+ "disk_name": disk.Name,
+ "order": disk.Order,
+ "params": disk.Params,
+ "parent_id": disk.ParentID,
+ "pci_slot": disk.PCISlot,
+ "pool": disk.Pool,
+ "present_to": disk.PresentTo,
+ "provision": disk.Provision,
+ "purge_time": disk.PurgeTime,
+ "replication": flattenDiskReplication(disk.Replication),
+ "res_id": disk.ResID,
+ "res_name": disk.ResName,
+ "role": disk.Role,
+ "sep_id": disk.SepID,
+ "sep_type": disk.SepType,
+ "shareable": disk.Shareable,
+ "cache": disk.Cache,
+ "size_available": disk.SizeAvailable,
+ "size_max": disk.SizeMax,
+ "size_used": disk.SizeUsed,
+ "snapshots": flattenDiskSnapshotList(disk.Snapshots),
+ "status": disk.Status,
+ "storage_policy_id": disk.StoragePolicyID,
+ "tech_status": disk.TechStatus,
+ "vmid": disk.VMID,
+ "updated_by": disk.UpdatedBy,
+ "updated_time": disk.UpdatedTime,
+ "to_clean": disk.ToClean,
}
res = append(res, temp)
}
@@ -311,3 +314,15 @@ func flattenDiskComputes(computes map[string]string) []map[string]interface{} {
}
return res
}
+
+func flattenDiskComputesReadOnly(computesReadOnly map[string]bool) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0)
+ for computeID, readOnly := range computesReadOnly {
+ temp := map[string]interface{}{
+ "compute_id": computeID,
+ "read_only": readOnly,
+ }
+ res = append(res, temp)
+ }
+ return res
+}
diff --git a/internal/service/cloudapi/disks/old_schemas.go b/internal/service/cloudapi/disks/old_schemas.go
index a5bca26d..2b292f3d 100644
--- a/internal/service/cloudapi/disks/old_schemas.go
+++ b/internal/service/cloudapi/disks/old_schemas.go
@@ -419,3 +419,12 @@ func resourceDiskV1() *schema.Resource {
},
}
}
+
+func resourceDiskV2() *schema.Resource {
+ s := resourceDiskSchemaMake()
+ s["blk_discard"] = &schema.Schema{
+ Type: schema.TypeBool,
+ Computed: true,
+ }
+ return &schema.Resource{Schema: s}
+}
diff --git a/internal/service/cloudapi/disks/resource_disk.go b/internal/service/cloudapi/disks/resource_disk.go
index 393dfcbd..d67e7984 100644
--- a/internal/service/cloudapi/disks/resource_disk.go
+++ b/internal/service/cloudapi/disks/resource_disk.go
@@ -558,6 +558,22 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_time": {
Type: schema.TypeInt,
Computed: true,
@@ -755,6 +771,10 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Name of the snapshot",
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"res_id": {
Type: schema.TypeString,
Computed: true,
@@ -805,10 +825,10 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeBool,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
- Description: "Flag indicating whether blk-discard is enabled for the disk",
+ Description: "Discard mode of the disk",
},
"block_size": {
Type: schema.TypeString,
@@ -821,7 +841,7 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
func ResourceDisk() *schema.Resource {
return &schema.Resource{
- SchemaVersion: 2,
+ SchemaVersion: 3,
CreateContext: resourceDiskCreate,
ReadContext: resourceDiskRead,
@@ -847,6 +867,11 @@ func ResourceDisk() *schema.Resource {
Upgrade: resourceDiskUpgradeV1,
Version: 1,
},
+ {
+ Type: resourceDiskV2().CoreConfigSchema().ImpliedType(),
+ Upgrade: resourceDiskUpgradeV2,
+ Version: 2,
+ },
},
}
}
diff --git a/internal/service/cloudapi/disks/state_upgraders.go b/internal/service/cloudapi/disks/state_upgraders.go
index 50fd2672..b7bc3bf8 100644
--- a/internal/service/cloudapi/disks/state_upgraders.go
+++ b/internal/service/cloudapi/disks/state_upgraders.go
@@ -12,3 +12,17 @@ func resourceDiskUpgradeV1(ctx context.Context, rawState map[string]interface{},
return rawState, nil
}
+
+func resourceDiskUpgradeV2(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
+ log.Debug("resourceDiskUpgradeV2: upgrading state")
+ if v, ok := rawState["blk_discard"].(bool); ok {
+ if v {
+ rawState["discard"] = "unmap"
+ } else {
+ rawState["discard"] = "ignore"
+ }
+ }
+ delete(rawState, "blk_discard")
+
+ return rawState, nil
+}
diff --git a/internal/service/cloudapi/extnet/data_source_extnet_list.go b/internal/service/cloudapi/extnet/data_source_extnet_list.go
index cc16db24..e03f1663 100644
--- a/internal/service/cloudapi/extnet/data_source_extnet_list.go
+++ b/internal/service/cloudapi/extnet/data_source_extnet_list.go
@@ -138,6 +138,10 @@ func dataSourceExtnetListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "free_ips": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
},
},
},
diff --git a/internal/service/cloudapi/extnet/flattens.go b/internal/service/cloudapi/extnet/flattens.go
index c7e0330c..573c70a0 100644
--- a/internal/service/cloudapi/extnet/flattens.go
+++ b/internal/service/cloudapi/extnet/flattens.go
@@ -133,10 +133,11 @@ func flattenExtnetList(el *extnet.ListExtNets) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(el.Data))
for _, e := range el.Data {
temp := map[string]interface{}{
- "net_id": e.ID,
- "ipcidr": e.IPCIDR,
- "name": e.Name,
- "status": e.Status,
+ "net_id": e.ID,
+ "ipcidr": e.IPCIDR,
+ "name": e.Name,
+ "status": e.Status,
+ "free_ips": e.FreeIPs,
}
res = append(res, temp)
}
diff --git a/internal/service/cloudapi/image/data_source_image_list.go b/internal/service/cloudapi/image/data_source_image_list.go
index 9ff16046..77ffc9f0 100644
--- a/internal/service/cloudapi/image/data_source_image_list.go
+++ b/internal/service/cloudapi/image/data_source_image_list.go
@@ -83,9 +83,10 @@ func dataSourceImageListSchemaMake() map[string]*schema.Schema {
Description: "Filter by architecture",
},
"type_image": {
- Type: schema.TypeString,
+ Type: schema.TypeList,
Optional: true,
Description: "Filter by image type",
+ Elem: &schema.Schema{Type: schema.TypeString},
},
"image_size": {
Type: schema.TypeInt,
diff --git a/internal/service/cloudapi/image/flattens.go b/internal/service/cloudapi/image/flattens.go
index ce2694cd..4532fd0a 100644
--- a/internal/service/cloudapi/image/flattens.go
+++ b/internal/service/cloudapi/image/flattens.go
@@ -64,7 +64,7 @@ func flattenImage(d *schema.ResourceData, img *image.RecordImage) {
d.Set("storage_policy_id", img.StoragePolicyID)
d.Set("tech_status", img.TechStatus)
d.Set("to_clean", img.ToClean)
- d.Set("type", img.Type)
+ d.Set("image_type", img.Type)
d.Set("username", img.Username)
d.Set("version", img.Version)
}
@@ -90,7 +90,7 @@ func flattenImageList(il *image.ListImages) []map[string]interface{} {
"size": img.Size,
"status": img.Status,
"storage_policy_id": img.StoragePolicyID,
- "type": img.Type,
+ "type_image": img.Type,
"username": img.Username,
"virtual": img.Virtual,
}
diff --git a/internal/service/cloudapi/image/image_item_subresource.go b/internal/service/cloudapi/image/image_item_subresource.go
index 45d322c3..eda54461 100644
--- a/internal/service/cloudapi/image/image_item_subresource.go
+++ b/internal/service/cloudapi/image/image_item_subresource.go
@@ -129,7 +129,7 @@ func dataSourceImageSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
- "type": {
+ "type_image": {
Type: schema.TypeString,
Computed: true,
Description: "Image type",
diff --git a/internal/service/cloudapi/image/image_virtual_rs_subresource.go b/internal/service/cloudapi/image/image_virtual_rs_subresource.go
index c1823136..87bf63b5 100644
--- a/internal/service/cloudapi/image/image_virtual_rs_subresource.go
+++ b/internal/service/cloudapi/image/image_virtual_rs_subresource.go
@@ -38,6 +38,7 @@ import (
func resourceImageVirtualSchemaMake(sch map[string]*schema.Schema) map[string]*schema.Schema {
delete(sch, "show_all")
+
sch["name"] = &schema.Schema{
Type: schema.TypeString,
Required: true,
@@ -52,9 +53,8 @@ func resourceImageVirtualSchemaMake(sch map[string]*schema.Schema) map[string]*s
sch["account_id"] = &schema.Schema{
Type: schema.TypeInt,
- Optional: true,
- Computed: true,
- Description: "account_id",
+ Required: true,
+ Description: "Account ID",
}
sch["image_id"] = &schema.Schema{
diff --git a/internal/service/cloudapi/image/utility_image_list.go b/internal/service/cloudapi/image/utility_image_list.go
index 42ec57e4..95603e69 100644
--- a/internal/service/cloudapi/image/utility_image_list.go
+++ b/internal/service/cloudapi/image/utility_image_list.go
@@ -63,7 +63,9 @@ func utilityImageListCheckPresence(ctx context.Context, d *schema.ResourceData,
}
if typeImage, ok := d.GetOk("type_image"); ok {
- req.TypeImage = typeImage.(string)
+ for _, v := range typeImage.([]interface{}) {
+ req.TypeImage = append(req.TypeImage, v.(string))
+ }
}
if imageSize, ok := d.GetOk("image_size"); ok {
diff --git a/internal/service/cloudapi/k8s/resource_k8s.go b/internal/service/cloudapi/k8s/resource_k8s.go
index 3582643f..a6c5b6cb 100644
--- a/internal/service/cloudapi/k8s/resource_k8s.go
+++ b/internal/service/cloudapi/k8s/resource_k8s.go
@@ -653,7 +653,7 @@ func resourceK8sSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Required: true,
//ForceNew: true,
- Description: "ID of the k8s catalog item to base this instance on.",
+ Description: "ID of the k8s catalog item to base this instance on. The maximum supported Kubernetes version is < 1.29.",
},
"wg_name": {
Type: schema.TypeString,
@@ -805,13 +805,13 @@ func resourceK8sSchemaMake() map[string]*schema.Schema {
Description: "insert ssl certificate in x509 pem format",
},
- "chipset": {
- Type: schema.TypeString,
- Optional: true,
- ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
- Default: "Q35",
- Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
- },
+ "chipset": {
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
+ Default: "Q35",
+ Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
+ },
"desc": {
Type: schema.TypeString,
diff --git a/internal/service/cloudapi/k8s/resource_k8s_cp.go b/internal/service/cloudapi/k8s/resource_k8s_cp.go
index 8489fc16..6da65c61 100644
--- a/internal/service/cloudapi/k8s/resource_k8s_cp.go
+++ b/internal/service/cloudapi/k8s/resource_k8s_cp.go
@@ -673,7 +673,7 @@ func resourceK8sCPSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Required: true,
//ForceNew: true,
- Description: "ID of the k8s catalog item to base this instance on.",
+ Description: "ID of the k8s catalog item to base this instance on. The maximum supported Kubernetes version is < 1.29.",
},
"network_plugin": {
Type: schema.TypeString,
@@ -715,13 +715,13 @@ func resourceK8sCPSchemaMake() map[string]*schema.Schema {
),
Description: "Node RAM in MB.",
},
- "chipset": {
- Type: schema.TypeString,
- Optional: true,
- ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
- Default: "Q35",
- Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
- },
+ "chipset": {
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
+ Default: "Q35",
+ Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
+ },
"disk": {
Type: schema.TypeInt,
Optional: true,
diff --git a/internal/service/cloudapi/kvmvm/data_source_compute.go b/internal/service/cloudapi/kvmvm/data_source_compute.go
index 327aeb36..b29ddf80 100644
--- a/internal/service/cloudapi/kvmvm/data_source_compute.go
+++ b/internal/service/cloudapi/kvmvm/data_source_compute.go
@@ -220,8 +220,12 @@ func computeSnapshotsSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"reference_id": {
- Type: schema.TypeInt,
+ Type: schema.TypeString,
Computed: true,
},
"res_id": {
@@ -244,20 +248,44 @@ func computeSnapshotsSchemaMake() map[string]*schema.Schema {
}
func computeListDisksSchemaMake() map[string]*schema.Schema {
return map[string]*schema.Schema{
- "_ckey": {
+ /*"_ckey": {
Type: schema.TypeString,
Computed: true,
- },
- "acl": {
- Type: schema.TypeString,
+ },*/
+ /*"acl": {
+ Type: schema.TypeList,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "user_group_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "right": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "explicit": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
Computed: true,
- },
+ },*/
"account_id": {
Type: schema.TypeInt,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -316,10 +344,11 @@ func computeListDisksSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
- "image_name": {
+ // TODO
+ /*"image_name": {
Type: schema.TypeString,
Computed: true,
- },
+ },*/
"images": {
Type: schema.TypeList,
Computed: true,
@@ -489,6 +518,10 @@ func computeListDisksSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
}
}
@@ -539,6 +572,10 @@ func computeInterfacesSchemaMake() map[string]*schema.Schema {
Type: schema.TypeBool,
Computed: true,
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"flip_group_id": {
Type: schema.TypeInt,
Computed: true,
@@ -708,8 +745,13 @@ func computeSnapSetsSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "memory_dump_image": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
}
}
+
func dataSourceComputeSchemaMake() map[string]*schema.Schema {
return map[string]*schema.Schema{
"compute_id": {
@@ -766,6 +808,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "clock": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"boot_order": {
Type: schema.TypeList,
Computed: true,
@@ -789,6 +835,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"pci_devices": {
Type: schema.TypeList,
Computed: true,
@@ -807,6 +857,26 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
"cpu_pin": {
Type: schema.TypeBool,
Computed: true,
@@ -998,6 +1068,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeBool,
Computed: true,
},
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"res_name": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudapi/kvmvm/data_source_compute_audits.go b/internal/service/cloudapi/kvmvm/data_source_compute_audits.go
index fd6a97f7..2d8f1698 100644
--- a/internal/service/cloudapi/kvmvm/data_source_compute_audits.go
+++ b/internal/service/cloudapi/kvmvm/data_source_compute_audits.go
@@ -136,6 +136,8 @@ func DataSourceComputeAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_audit_list instead.",
+
ReadContext: dataSourceComputeAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudapi/kvmvm/data_source_compute_cpu_alignment_profile.go b/internal/service/cloudapi/kvmvm/data_source_compute_cpu_alignment_profile.go
new file mode 100644
index 00000000..4d604047
--- /dev/null
+++ b/internal/service/cloudapi/kvmvm/data_source_compute_cpu_alignment_profile.go
@@ -0,0 +1,98 @@
+/*
+Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+Kasim Baybikov,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package kvmvm
+
+import (
+ "context"
+
+ "github.com/google/uuid"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
+)
+
+func dataSourceComputeCPUAlignmentProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
+ profile, err := utilityComputeGetCPUAlignmentProfile(ctx, d, m)
+ if err != nil {
+ d.SetId("")
+ return diag.FromErr(err)
+ }
+
+ id := uuid.New()
+ d.SetId(id.String())
+ d.Set("model", profile.Model)
+ d.Set("name", profile.Name)
+ d.Set("vendor", profile.Vendor)
+
+ return nil
+}
+
+func dataSourceComputeCPUAlignmentProfileSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "ID of the compute instance",
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "CPU model of the alignment profile",
+ },
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Name of the CPU alignment profile",
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "CPU vendor of the alignment profile",
+ },
+ }
+}
+
+func DataSourceComputeCPUAlignmentProfile() *schema.Resource {
+ return &schema.Resource{
+ SchemaVersion: 1,
+
+ ReadContext: dataSourceComputeCPUAlignmentProfileRead,
+
+ Timeouts: &schema.ResourceTimeout{
+ Read: &constants.Timeout30s,
+ Default: &constants.Timeout60s,
+ },
+
+ Schema: dataSourceComputeCPUAlignmentProfileSchemaMake(),
+ }
+}
diff --git a/internal/service/cloudapi/kvmvm/data_source_compute_get_audits.go b/internal/service/cloudapi/kvmvm/data_source_compute_get_audits.go
index 4bee35a3..08866453 100644
--- a/internal/service/cloudapi/kvmvm/data_source_compute_get_audits.go
+++ b/internal/service/cloudapi/kvmvm/data_source_compute_get_audits.go
@@ -83,6 +83,8 @@ func DataSourceComputeGetAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_audit_list instead.",
+
ReadContext: dataSourceComputeGetAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudapi/kvmvm/data_source_compute_list.go b/internal/service/cloudapi/kvmvm/data_source_compute_list.go
index 3e47a901..de95a147 100644
--- a/internal/service/cloudapi/kvmvm/data_source_compute_list.go
+++ b/internal/service/cloudapi/kvmvm/data_source_compute_list.go
@@ -80,6 +80,10 @@ func computeDisksSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
}
}
func itemComputeSchemaMake() map[string]*schema.Schema {
@@ -156,6 +160,10 @@ func itemComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "clock": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"clones": {
Type: schema.TypeList,
Computed: true,
@@ -167,6 +175,26 @@ func itemComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
"cpu_pin": {
Type: schema.TypeBool,
Computed: true,
@@ -335,6 +363,10 @@ func itemComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeBool,
Computed: true,
},
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"res_name": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudapi/kvmvm/flattens.go b/internal/service/cloudapi/kvmvm/flattens.go
index c0c4615e..dcb4a8e9 100644
--- a/internal/service/cloudapi/kvmvm/flattens.go
+++ b/internal/service/cloudapi/kvmvm/flattens.go
@@ -50,7 +50,8 @@ func flattenDisks(disks []compute.InfoDisk) []map[string]interface{} {
// "bus_number": disk.BusNumber,
"disk_id": disk.ID,
// "pci_slot": disk.PCISlot,
- "sep_id": disk.SepID,
+ "sep_id": disk.SepID,
+ "read_only": disk.ReadOnly,
}
res = append(res, temp)
}
@@ -71,32 +72,33 @@ func flattenInterfaces(interfaces compute.ListInterfaces) []map[string]interface
res := make([]map[string]interface{}, 0, len(interfaces))
for _, interfaceItem := range interfaces {
temp := map[string]interface{}{
- "bus_number": interfaceItem.BusNumber,
- "conn_id": interfaceItem.ConnID,
- "conn_type": interfaceItem.ConnType,
- "def_gw": interfaceItem.DefGW,
- "enabled": interfaceItem.Enabled,
- "enable_secgroups": interfaceItem.EnableSecGroups,
- "flip_group_id": interfaceItem.FLIPGroupID,
- "guid": interfaceItem.GUID,
- "ip_address": interfaceItem.IPAddress,
- "listen_ssh": interfaceItem.ListenSSH,
- "mac": interfaceItem.MAC,
- "mtu": interfaceItem.MTU,
- "name": interfaceItem.Name,
- "net_id": interfaceItem.NetID,
- "netmask": interfaceItem.NetMask,
- "net_type": interfaceItem.NetType,
- "node_id": interfaceItem.NodeID,
- "pci_slot": interfaceItem.PCISlot,
- "qos": flattenQOS(interfaceItem.QOS),
- "security_groups": interfaceItem.SecGroups,
- "sdn_interface_id": interfaceItem.SDNInterfaceID,
- "target": interfaceItem.Target,
- "type": interfaceItem.Type,
- "trunk_tags": interfaceItem.TrunkTags,
- "vnfs": interfaceItem.VNFs,
- "libvirt_settings": flattenLibvirtSettings(interfaceItem.LibvirtSettings),
+ "bus_number": interfaceItem.BusNumber,
+ "conn_id": interfaceItem.ConnID,
+ "conn_type": interfaceItem.ConnType,
+ "def_gw": interfaceItem.DefGW,
+ "enabled": interfaceItem.Enabled,
+ "enable_secgroups": interfaceItem.EnableSecGroups,
+ "enable_default_gateway": interfaceItem.EnableDefaultGateway,
+ "flip_group_id": interfaceItem.FLIPGroupID,
+ "guid": interfaceItem.GUID,
+ "ip_address": interfaceItem.IPAddress,
+ "listen_ssh": interfaceItem.ListenSSH,
+ "mac": interfaceItem.MAC,
+ "mtu": interfaceItem.MTU,
+ "name": interfaceItem.Name,
+ "net_id": interfaceItem.NetID,
+ "netmask": interfaceItem.NetMask,
+ "net_type": interfaceItem.NetType,
+ "node_id": interfaceItem.NodeID,
+ "pci_slot": interfaceItem.PCISlot,
+ "qos": flattenQOS(interfaceItem.QOS),
+ "security_groups": interfaceItem.SecGroups,
+ "sdn_interface_id": interfaceItem.SDNInterfaceID,
+ "target": interfaceItem.Target,
+ "type": interfaceItem.Type,
+ "trunk_tags": interfaceItem.TrunkTags,
+ "vnfs": interfaceItem.VNFs,
+ "libvirt_settings": flattenLibvirtSettings(interfaceItem.LibvirtSettings),
}
res = append(res, temp)
}
@@ -122,10 +124,11 @@ func flattenSnapSets(snapSets compute.ListSnapSets) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(snapSets))
for _, snapSet := range snapSets {
temp := map[string]interface{}{
- "disks": snapSet.Disks,
- "guid": snapSet.GUID,
- "label": snapSet.Label,
- "timestamp": snapSet.Timestamp,
+ "disks": snapSet.Disks,
+ "guid": snapSet.GUID,
+ "label": snapSet.Label,
+ "timestamp": snapSet.Timestamp,
+ "memory_dump_image": snapSet.MemoryDumpImage,
}
res = append(res, temp)
}
@@ -193,10 +196,12 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
"bootdisk_size": compute.BootDiskSize,
"boot_image_id": compute.BootImageID,
"chipset": compute.Chipset,
+ "clock": compute.Clock,
"cd_image_id": compute.CdImageId,
"clone_reference": compute.CloneReference,
"clones": compute.Clones,
"computeci_id": compute.ComputeCIID,
+ "cpu_alignment_profiles": flattenCPUAlignmentProfile(compute.CPUAlignmentProfile),
"cpu_pin": compute.CPUPin,
"cpus": compute.CPU,
"created_by": compute.CreatedBy,
@@ -232,6 +237,7 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
"registered": compute.Registered,
"res_name": compute.ResName,
"reserved_node_cpus": compute.ReservedNodeCpus,
+ "resized_online": compute.ResizedOnline,
"rg_id": compute.RGID,
"rg_name": compute.RGName,
"snap_sets": flattenSnapSets(compute.SnapSets),
@@ -278,7 +284,7 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{}
"storage_policy_id": bootDisk.StoragePolicyID,
"to_clean": bootDisk.ToClean,
"cache": bootDisk.Cache,
- "blk_discard": bootDisk.BLKDiscard,
+ "discard": bootDisk.Discard,
"block_size": bootDisk.BlockSize,
"bus_number": bootDisk.BusNumber,
"provision": bootDisk.Provision,
@@ -289,6 +295,7 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{}
"deleted_time": bootDisk.DeletedTime,
"updated_time": bootDisk.UpdatedTime,
"devicename": bootDisk.DeviceName,
+ "read_only": bootDisk.ReadOnly,
}
res = append(res, temp)
@@ -346,10 +353,11 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex
"updated_time": disk.UpdatedTime,
"permanently": pernamentlyValue,
"cache": disk.Cache,
- "blk_discard": disk.BLKDiscard,
+ "discard": disk.Discard,
"block_size": disk.BlockSize,
"provision": disk.Provision,
"iotune": flattenIotune(disk.IOTune),
+ "read_only": disk.ReadOnly,
}
res = append(res, temp)
indexDataDisks++
@@ -363,15 +371,16 @@ func flattenNetwork(networks []interface{}, interfaces compute.ListInterfaces) [
for _, network := range interfaces {
temp := map[string]interface{}{
- "net_id": network.NetID,
- "net_type": network.NetType,
- "ip_address": network.IPAddress,
- "mac": network.MAC,
- "mtu": network.MTU,
- "net_mask": network.NetMask,
- "sdn_interface_id": network.SDNInterfaceID,
- "weight": flattenNetworkWeight(networks, network.NetID, network.NetType),
- "enabled": network.Enabled,
+ "net_id": network.NetID,
+ "net_type": network.NetType,
+ "ip_address": network.IPAddress,
+ "mac": network.MAC,
+ "mtu": network.MTU,
+ "net_mask": network.NetMask,
+ "sdn_interface_id": network.SDNInterfaceID,
+ "weight": flattenNetworkWeight(networks, network.NetID, network.NetType),
+ "enabled": network.Enabled,
+ "enable_default_gateway": network.EnableDefaultGateway,
}
res = append(res, temp)
}
@@ -440,6 +449,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
d.Set("sep_id", bootDisk.SepID)
d.Set("pool", bootDisk.Pool)
d.Set("chipset", computeRec.Chipset)
+ d.Set("clock", computeRec.Clock)
d.Set("clone_reference", computeRec.CloneReference)
d.Set("clones", computeRec.Clones)
d.Set("computeci_id", computeRec.ComputeCIID)
@@ -484,6 +494,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
d.Set("registered", computeRec.Registered)
d.Set("res_name", computeRec.ResName)
d.Set("reserved_node_cpus", computeRec.ReservedNodeCpus)
+ d.Set("resized_online", computeRec.ResizedOnline)
d.Set("rg_id", computeRec.RGID)
d.Set("rg_name", computeRec.RGName)
d.Set("snap_sets", flattenSnapSets(computeRec.SnapSets))
@@ -505,6 +516,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
d.Set("zone_id", computeRec.ZoneID)
d.Set("loader_meta_iso", flattenLoaderMetaIso(computeRec.LoaderMetaIso))
d.Set("cpu_pin", computeRec.CPUPin)
+ d.Set("cpu_alignment_profile", computeRec.CPUAlignmentProfile.Name)
d.Set("numa_affinity", computeRec.NumaAffinity)
d.Set("hp_backed", computeRec.HPBacked)
d.Set("weight", computeRec.Weight)
@@ -565,6 +577,20 @@ func flattenAffinityRules(affinityRules compute.ListRules) []map[string]interfac
return res
}
+/*func flattenDisksACL(acl compute.ItemDisksACL) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0)
+ temp := map[string]interface{}{
+ "user_group_id": acl.UserGroupID,
+ "type": acl.Type,
+ "right": acl.Right,
+ "status": acl.Status,
+ "explicit": acl.Explicit,
+ }
+
+ res = append(res, temp)
+ return res
+}*/
+
func flattenIotune(iotune compute.IOTune) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
temp := map[string]interface{}{
@@ -593,6 +619,7 @@ func flattenSnapshots(snapshots compute.SnapshotExtendList) []map[string]interfa
temp := map[string]interface{}{
"guid": snapshot.GUID,
"label": snapshot.Label,
+ "pool_name": snapshot.PoolName,
"res_id": snapshot.ResID,
"reference_id": snapshot.ReferenceID,
"snap_set_guid": snapshot.SnapSetGUID,
@@ -607,13 +634,14 @@ func flattenSnapshots(snapshots compute.SnapshotExtendList) []map[string]interfa
func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(disks))
+ log.Debug("flattenListComputeDisks:", disks)
for _, disk := range disks {
- acl, _ := json.Marshal(disk.ACL)
temp := map[string]interface{}{
- "_ckey": disk.CKey,
- "acl": string(acl),
+ //"_ckey": disk.CKey,
+ // TODO
+ //"acl": flattenDisksACL(disk.ACL),
"account_id": disk.AccountID,
- "blk_discard": disk.BLKDiscard,
+ "discard": disk.Discard,
"block_size": disk.BlockSize,
"boot_partition": disk.BootPartition,
"bus_number": disk.BusNumber,
@@ -660,6 +688,7 @@ func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interf
"to_clean": disk.ToClean,
"provision": disk.Provision,
"updated_time": disk.UpdatedTime,
+ "read_only": disk.ReadOnly,
}
res = append(res, temp)
}
@@ -713,6 +742,7 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
d.Set("auto_start_w_node", computeRec.AutoStart)
d.Set("arch", computeRec.Architecture)
d.Set("chipset", computeRec.Chipset)
+ d.Set("clock", computeRec.Clock)
d.Set("boot_order", computeRec.BootOrder)
d.Set("bootdisk_size", computeRec.BootDiskSize)
d.Set("boot_image_id", computeRec.BootImageID)
@@ -729,7 +759,10 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
d.Set("deleted_time", computeRec.DeletedTime)
d.Set("desc", computeRec.Description)
d.Set("devices", string(devices))
- d.Set("disks", flattenListComputeDisks(computeRec.Disks))
+ err := d.Set("disks", flattenListComputeDisks(computeRec.Disks))
+ if err != nil {
+ log.Debugf("error in flattenDataCompute: %v", err)
+ }
d.Set("driver", computeRec.Driver)
d.Set("gid", computeRec.GID)
d.Set("guid", computeRec.GUID)
@@ -762,6 +795,7 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
d.Set("registered", computeRec.Registered)
d.Set("res_name", computeRec.ResName)
d.Set("reserved_node_cpus", computeRec.ReservedNodeCpus)
+ d.Set("resized_online", computeRec.ResizedOnline)
d.Set("rg_id", computeRec.RGID)
d.Set("rg_name", computeRec.RGName)
d.Set("snap_sets", flattenSnapSets(computeRec.SnapSets))
@@ -785,9 +819,23 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
d.Set("zone_id", computeRec.ZoneID)
d.Set("loader_meta_iso", flattenLoaderMetaIso(computeRec.LoaderMetaIso))
d.Set("os_version", computeRec.OSVersion)
+ d.Set("cpu_alignment_profiles", flattenCPUAlignmentProfile(computeRec.CPUAlignmentProfile))
d.Set("weight", computeRec.Weight)
}
+func flattenCPUAlignmentProfile(profile compute.CPUAlignmentProfile) []map[string]interface{} {
+ if profile.Name == "" && profile.Model == "" && profile.Vendor == "" {
+ return nil
+ }
+ return []map[string]interface{}{
+ {
+ "name": profile.Name,
+ "model": profile.Model,
+ "vendor": profile.Vendor,
+ },
+ }
+}
+
func flattenPCI(pciList compute.ListPCIDevices) []uint64 {
res := make([]uint64, 0, len(pciList.Data))
diff --git a/internal/service/cloudapi/kvmvm/network_subresource.go b/internal/service/cloudapi/kvmvm/network_subresource.go
index 75d6d900..47b1dce6 100644
--- a/internal/service/cloudapi/kvmvm/network_subresource.go
+++ b/internal/service/cloudapi/kvmvm/network_subresource.go
@@ -185,6 +185,13 @@ func networkSubresourceSchemaMake() map[string]*schema.Schema {
Description: "network enable flag",
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ Description: "Flag indicating whether default gateway is enabled for this interface. Applicable only to VINS network type",
+ },
+
"net_mask": {
Type: schema.TypeInt,
Optional: true,
diff --git a/internal/service/cloudapi/kvmvm/old_schemas.go b/internal/service/cloudapi/kvmvm/old_schemas.go
index c56c3890..0c09ce1a 100644
--- a/internal/service/cloudapi/kvmvm/old_schemas.go
+++ b/internal/service/cloudapi/kvmvm/old_schemas.go
@@ -1427,3 +1427,19 @@ func resourceComputeResourceV2() *schema.Resource {
},
}
}
+
+func resourceComputeResourceV3() *schema.Resource {
+ s := ResourceComputeSchemaMake()
+
+ for _, blockKey := range []string{"disks", "boot_disk"} {
+ if block, ok := s[blockKey]; ok {
+ if res, ok := block.Elem.(*schema.Resource); ok {
+ res.Schema["blk_discard"] = &schema.Schema{
+ Type: schema.TypeBool,
+ Computed: true,
+ }
+ }
+ }
+ }
+ return &schema.Resource{Schema: s}
+}
diff --git a/internal/service/cloudapi/kvmvm/resource_compute.go b/internal/service/cloudapi/kvmvm/resource_compute.go
index 3e139012..02521ddb 100644
--- a/internal/service/cloudapi/kvmvm/resource_compute.go
+++ b/internal/service/cloudapi/kvmvm/resource_compute.go
@@ -135,8 +135,6 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
createReqX86.BootDisk = uint64(bootSize.(int))
}
- createReqX86.Interfaces = make([]kvmx86.Interface, 0)
-
if networks, ok := d.GetOk("network"); ok {
if networks.(*schema.Set).Len() > 0 {
ns := networks.(*schema.Set).List()
@@ -164,6 +162,10 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
reqInterface.Enabled = netInterfaceVal["enabled"].(bool)
}
+ if reqInterface.NetType == "VINS" {
+ reqInterface.EnableDefaultGateway = netInterfaceVal["enable_default_gateway"].(bool)
+ }
+
if reqInterface.NetType == "DPDK" || reqInterface.NetType == "EXTNET" || reqInterface.NetType == "TRUNK" {
reqInterface.MTU = uint64(netInterfaceVal["mtu"].(int))
}
@@ -264,6 +266,9 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
createReqX86.CPUPin = d.Get("cpu_pin").(bool)
createReqX86.HPBacked = d.Get("hp_backed").(bool)
createReqX86.Chipset = d.Get("chipset").(string)
+ if clock, ok := d.GetOk("clock"); ok {
+ createReqX86.Clock = clock.(string)
+ }
if preferredCPU, ok := d.GetOk("preferred_cpu"); ok {
preferredList := preferredCPU.([]interface{})
@@ -513,6 +518,17 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
}
}
+ if profileName, ok := d.GetOk("cpu_alignment_profile"); ok {
+ req := compute.SetCPUAlignmentProfileRequest{
+ ComputeIDs: []int64{int64(computeId)},
+ CPUAlignmentProfile: profileName.(string),
+ }
+ _, err := c.CloudAPI().Compute().SetCPUAlignmentProfile(ctx, req)
+ if err != nil {
+ warnings.Add(err)
+ }
+ }
+
if ars, ok := d.GetOk("affinity_rules"); ok {
log.Debugf("resourceComputeCreate: Create affinity rules on ComputeID: %d", computeId)
addedAR := ars.([]interface{})
@@ -968,9 +984,9 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
}
}
- // Note bene: numa_affinity, cpu_pin and hp_backed are not allowed to be changed for compute in STARTED tech status.
+ // Note bene: numa_affinity, cpu_pin, hp_backed and clock are not allowed to be changed for compute in STARTED tech status.
var isStopRequired bool
- if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed", "chipset", "preferred_cpu", "hot_resize") && d.Get("started").(bool) {
+ if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed", "chipset", "preferred_cpu", "hot_resize", "clock") && d.Get("started").(bool) {
isStopRequired = true
}
@@ -1042,6 +1058,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
if d.HasChanges("description",
"name",
+ "clock",
"numa_affinity",
"cpu_pin",
"hp_backed",
@@ -1069,6 +1086,9 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
if d.HasChange("chipset") {
req.Chipset = d.Get("chipset").(string)
}
+ if d.HasChange("clock") {
+ req.Clock = d.Get("clock").(string)
+ }
if d.HasChange("preferred_cpu") {
if preferredCPU, ok := d.GetOk("preferred_cpu"); ok {
preferredList := preferredCPU.([]interface{})
@@ -1242,6 +1262,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
if diskConv["image_id"].(int) != 0 {
req.ImageID = uint64(diskConv["image_id"].(int))
}
+ req.ReadOnly = diskConv["read_only"].(bool)
diskID, err := c.CloudAPI().Compute().DiskAdd(ctx, req)
if err != nil {
return diag.FromErr(err)
@@ -1911,6 +1932,12 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
}
}
+ if d.HasChange("cpu_alignment_profile") {
+ if err := utilityComputeUpdateCPUAlignmentProfile(ctx, d, m); err != nil {
+ return diag.FromErr(err)
+ }
+ }
+
// we may reuse dataSourceComputeRead here as we maintain similarity
// between Compute resource and Compute data source schemas
@@ -2095,6 +2122,12 @@ func disksSubresourceSchemaMake() map[string]*schema.Schema {
Optional: true,
Description: "Disk deletion status",
},
+ "read_only": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "Mount disk in read-only mode",
+ },
"iotune": {
Type: schema.TypeList,
Optional: true,
@@ -2230,8 +2263,8 @@ func disksSubresourceSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -2382,6 +2415,13 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false), // observe case while validating
Description: "Type of the emulated system.",
},
+ "clock": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "default",
+ ValidateFunc: validation.StringInSlice([]string{"default", "linux", "windows", "none"}, false),
+ Description: "Clock synchronization mode.",
+ },
"without_boot_disk": {
Type: schema.TypeBool,
Optional: true,
@@ -2405,6 +2445,11 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
Optional: true,
Description: "Set affinity label for compute",
},
+ "cpu_alignment_profile": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "CPU alignment profile name",
+ },
"affinity_rules": {
Type: schema.TypeList,
Optional: true,
@@ -2931,6 +2976,10 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
},
},
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"rg_name": {
Type: schema.TypeString,
Computed: true,
@@ -3095,7 +3144,7 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
func ResourceCompute() *schema.Resource {
return &schema.Resource{
- SchemaVersion: 3,
+ SchemaVersion: 4,
CreateContext: resourceComputeCreate,
ReadContext: resourceComputeRead,
@@ -3142,6 +3191,11 @@ func ResourceCompute() *schema.Resource {
Upgrade: resourceComputeStateUpgradeV2,
Version: 2,
},
+ {
+ Type: resourceComputeResourceV3().CoreConfigSchema().ImpliedType(),
+ Upgrade: resourceComputeStateUpgradeV3,
+ Version: 3,
+ },
},
}
}
diff --git a/internal/service/cloudapi/kvmvm/state_upgraders.go b/internal/service/cloudapi/kvmvm/state_upgraders.go
index 275fc5ef..320956d1 100644
--- a/internal/service/cloudapi/kvmvm/state_upgraders.go
+++ b/internal/service/cloudapi/kvmvm/state_upgraders.go
@@ -34,8 +34,31 @@ func resourceCompueteStateUpgradeV1(ctx context.Context, rawState map[string]int
func resourceComputeStateUpgradeV2(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
log.Debug("resourceComputeStateUpgradeV2: upgrading state")
-
+
delete(rawState, "with_default_vins")
return rawState, nil
}
+
+func resourceComputeStateUpgradeV3(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
+ log.Debug("resourceComputeStateUpgradeV3: upgrading state")
+
+ for _, blockKey := range []string{"disks", "boot_disk"} {
+ if items, ok := rawState[blockKey].([]interface{}); ok {
+ for _, item := range items {
+ if disk, ok := item.(map[string]interface{}); ok {
+ if v, ok := disk["blk_discard"].(bool); ok {
+ if v {
+ disk["discard"] = "unmap"
+ } else {
+ disk["discard"] = "ignore"
+ }
+ }
+ delete(disk, "blk_discard")
+ }
+ }
+ }
+ }
+
+ return rawState, nil
+}
diff --git a/internal/service/cloudapi/kvmvm/utility_compute.go b/internal/service/cloudapi/kvmvm/utility_compute.go
index fd44dd56..031f49ad 100644
--- a/internal/service/cloudapi/kvmvm/utility_compute.go
+++ b/internal/service/cloudapi/kvmvm/utility_compute.go
@@ -278,6 +278,10 @@ func utilityComputeNetworksConfigure(ctx context.Context, d *schema.ResourceData
req.Enabled = netData["enabled"].(bool)
}
+ if req.NetType == "VINS" {
+ req.EnableDefaultGateway = netData["enable_default_gateway"].(bool)
+ }
+
if req.NetType == "DPDK" || req.NetType == "EXTNET" {
req.MTU = uint64(netData["mtu"].(int))
}
diff --git a/internal/service/cloudapi/kvmvm/utility_compute_cpu_alignment_profile.go b/internal/service/cloudapi/kvmvm/utility_compute_cpu_alignment_profile.go
new file mode 100644
index 00000000..1ea915bd
--- /dev/null
+++ b/internal/service/cloudapi/kvmvm/utility_compute_cpu_alignment_profile.go
@@ -0,0 +1,71 @@
+/*
+Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+Kasim Baybikov,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package kvmvm
+
+import (
+ "context"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
+)
+
+func utilityComputeUpdateCPUAlignmentProfile(ctx context.Context, d *schema.ResourceData, m interface{}) error {
+ c := m.(*controller.ControllerCfg)
+ computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
+
+ profileName := d.Get("cpu_alignment_profile").(string)
+ if profileName == "" {
+ req := compute.DeleteCPUAlignmentProfileRequest{
+ ComputeIDs: []uint64{computeId},
+ }
+ _, err := c.CloudAPI().Compute().DeleteCPUAlignmentProfile(ctx, req)
+ return err
+ }
+
+ req := compute.SetCPUAlignmentProfileRequest{
+ ComputeIDs: []int64{int64(computeId)},
+ CPUAlignmentProfile: profileName,
+ }
+ _, err := c.CloudAPI().Compute().SetCPUAlignmentProfile(ctx, req)
+ return err
+}
+
+func utilityComputeGetCPUAlignmentProfile(ctx context.Context, d *schema.ResourceData, m interface{}) (*compute.CPUAlignmentProfile, error) {
+ c := m.(*controller.ControllerCfg)
+ req := compute.GetCPUAlignmentProfileRequest{
+ ComputeID: uint64(d.Get("compute_id").(int)),
+ }
+ return c.CloudAPI().Compute().GetCPUAlignmentProfile(ctx, req)
+}
diff --git a/internal/service/cloudapi/rg/data_source_rg.go b/internal/service/cloudapi/rg/data_source_rg.go
index 56f132fc..83d2ed65 100644
--- a/internal/service/cloudapi/rg/data_source_rg.go
+++ b/internal/service/cloudapi/rg/data_source_rg.go
@@ -420,7 +420,7 @@ func dataSourceRgSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"sdn_access_group_id": {
diff --git a/internal/service/cloudapi/rg/data_source_rg_audits.go b/internal/service/cloudapi/rg/data_source_rg_audits.go
index 1acf4135..dd157c2c 100644
--- a/internal/service/cloudapi/rg/data_source_rg_audits.go
+++ b/internal/service/cloudapi/rg/data_source_rg_audits.go
@@ -97,6 +97,8 @@ func DataSourceRgAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_audit_list instead.",
+
ReadContext: dataSourceRgAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudapi/rg/data_source_rg_list.go b/internal/service/cloudapi/rg/data_source_rg_list.go
index 24e988ab..d0379e04 100644
--- a/internal/service/cloudapi/rg/data_source_rg_list.go
+++ b/internal/service/cloudapi/rg/data_source_rg_list.go
@@ -251,7 +251,7 @@ func dataSourceRgListSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"uniq_pools": {
diff --git a/internal/service/cloudapi/rg/data_source_rg_list_deleted.go b/internal/service/cloudapi/rg/data_source_rg_list_deleted.go
index e93578a1..f1350e7e 100644
--- a/internal/service/cloudapi/rg/data_source_rg_list_deleted.go
+++ b/internal/service/cloudapi/rg/data_source_rg_list_deleted.go
@@ -240,7 +240,7 @@ func dataSourceRgListDeletedSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"uniq_pools": {
diff --git a/internal/service/cloudapi/rg/resource_rg.go b/internal/service/cloudapi/rg/resource_rg.go
index 2d3f1cfb..cbca22f0 100644
--- a/internal/service/cloudapi/rg/resource_rg.go
+++ b/internal/service/cloudapi/rg/resource_rg.go
@@ -147,6 +147,10 @@ func resourceResgroupCreate(ctx context.Context, d *schema.ResourceData, m inter
req.IPCIDR = ipcidr.(string)
}
+ if enableDefaultGateway, ok := d.GetOkExists("enable_default_gateway"); ok {
+ req.EnableDefaultGateway = enableDefaultGateway.(bool)
+ }
+
if description, ok := d.GetOk("description"); ok {
req.Description = description.(string)
}
@@ -597,7 +601,10 @@ func ResourceRgSchemaMake() map[string]*schema.Schema {
Required: true,
Description: "Name of this resource group. Names are case sensitive and unique within the context of a account.",
},
-
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Optional: true,
+ },
"def_net_type": {
Type: schema.TypeString,
Optional: true,
@@ -892,7 +899,7 @@ func ResourceRgSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"storage_policy_ids": {
diff --git a/internal/service/cloudapi/vins/data_source_vins.go b/internal/service/cloudapi/vins/data_source_vins.go
index 7004a2ec..36829bd6 100644
--- a/internal/service/cloudapi/vins/data_source_vins.go
+++ b/internal/service/cloudapi/vins/data_source_vins.go
@@ -939,6 +939,10 @@ func dataSourceVinsSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"default_qos": {
Type: schema.TypeList,
Computed: true,
diff --git a/internal/service/cloudapi/vins/data_source_vins_audits.go b/internal/service/cloudapi/vins/data_source_vins_audits.go
index b41428c9..90e014d3 100644
--- a/internal/service/cloudapi/vins/data_source_vins_audits.go
+++ b/internal/service/cloudapi/vins/data_source_vins_audits.go
@@ -97,6 +97,8 @@ func DataSourceVinsAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_audit_list instead.",
+
ReadContext: dataSourceVinsAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudapi/vins/flattens.go b/internal/service/cloudapi/vins/flattens.go
index e9d675a5..968fb950 100644
--- a/internal/service/cloudapi/vins/flattens.go
+++ b/internal/service/cloudapi/vins/flattens.go
@@ -395,6 +395,7 @@ func flattenVins(d *schema.ResourceData, vins *vins.RecordVINS) {
d.Set("created_by", vins.CreatedBy)
d.Set("created_time", vins.CreatedTime)
d.Set("default_gw", vins.DefaultGW)
+ d.Set("enable_default_gateway", vins.EnableDefaultGateway)
d.Set("default_qos", flattenQOS(vins.DefaultQOS))
d.Set("deleted_by", vins.DeletedBy)
d.Set("deleted_time", vins.DeletedTime)
@@ -433,6 +434,7 @@ func flattenVinsData(d *schema.ResourceData, vins *vins.RecordVINS) {
d.Set("created_by", vins.CreatedBy)
d.Set("created_time", vins.CreatedTime)
d.Set("default_gw", vins.DefaultGW)
+ d.Set("enable_default_gateway", vins.EnableDefaultGateway)
d.Set("default_qos", flattenQOS(vins.DefaultQOS))
d.Set("deleted_by", vins.DeletedBy)
d.Set("deleted_time", vins.DeletedTime)
diff --git a/internal/service/cloudapi/vins/resource_vins.go b/internal/service/cloudapi/vins/resource_vins.go
index f8cc2fc8..aa5a5189 100644
--- a/internal/service/cloudapi/vins/resource_vins.go
+++ b/internal/service/cloudapi/vins/resource_vins.go
@@ -145,6 +145,7 @@ func resourceVinsCreate(ctx context.Context, d *schema.ResourceData, m interface
}
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
+ req.EnableDefaultGateway = d.Get("enable_default_gateway").(bool)
id, err := c.CloudAPI().VINS().CreateInRG(ctx, req)
if err != nil {
@@ -184,6 +185,7 @@ func resourceVinsCreate(ctx context.Context, d *schema.ResourceData, m interface
}
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
+ req.EnableDefaultGateway = d.Get("enable_default_gateway").(bool)
id, err := c.CloudAPI().VINS().CreateInAccount(ctx, req)
if err != nil {
@@ -918,6 +920,12 @@ func resourceVinsSchemaMake() map[string]*schema.Schema {
Default: false,
Description: "enable security groups",
}
+ rets["enable_default_gateway"] = &schema.Schema{
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ Description: "Flag indicating whether default gateway is enabled for this VINS",
+ }
return rets
}
diff --git a/internal/service/cloudapi/zone/data_source_zone.go b/internal/service/cloudapi/zone/data_source_zone.go
index 978784fb..0e82ca87 100644
--- a/internal/service/cloudapi/zone/data_source_zone.go
+++ b/internal/service/cloudapi/zone/data_source_zone.go
@@ -194,6 +194,34 @@ func dataSourceZoneSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
}
}
diff --git a/internal/service/cloudapi/zone/data_source_zone_list.go b/internal/service/cloudapi/zone/data_source_zone_list.go
index cfc00b54..04080c8b 100644
--- a/internal/service/cloudapi/zone/data_source_zone_list.go
+++ b/internal/service/cloudapi/zone/data_source_zone_list.go
@@ -202,6 +202,34 @@ func dataSourceZoneListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
},
},
},
diff --git a/internal/service/cloudapi/zone/flattens.go b/internal/service/cloudapi/zone/flattens.go
index 8f49584c..d63d8529 100644
--- a/internal/service/cloudapi/zone/flattens.go
+++ b/internal/service/cloudapi/zone/flattens.go
@@ -38,6 +38,18 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/zone"
)
+func flattenCpuAlignmentProfiles(profiles []zone.CpuAlignmentProfile) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(profiles))
+ for _, p := range profiles {
+ res = append(res, map[string]interface{}{
+ "name": p.Name,
+ "vendor": p.Vendor,
+ "model": p.Model,
+ })
+ }
+ return res
+}
+
func flattenZone(d *schema.ResourceData, item *zone.RecordZone) error {
log.Debugf("flattenZone: start decoding RecordZone name %q / ID %d",
item.Name, item.ID)
@@ -71,6 +83,9 @@ func flattenZone(d *schema.ResourceData, item *zone.RecordZone) error {
d.Set("ssl_skip_verify", item.SSLSkipVerify)
d.Set("domain", item.Domain)
d.Set("sso_type", item.SSOType)
+ d.Set("cpu_alignment_profiles", flattenCpuAlignmentProfiles(item.CpuAlignmentProfiles))
+ d.Set("reserved_cpu", item.ReservedCPU)
+ d.Set("reserved_ram", item.ReservedRAM)
log.Debugf("flattenZone: decoded RecordZone name %q / ID %d, complete",
item.Name, item.ID)
@@ -82,28 +97,31 @@ func flattenZoneList(zone *zone.ListZones) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(zone.Data))
for _, zone := range zone.Data {
temp := map[string]interface{}{
- "zone_id": int(zone.ID),
- "guid": int(zone.GUID),
- "gid": int(zone.GID),
- "name": zone.Name,
- "description": zone.Description,
- "deletable": zone.Deletable,
- "status": zone.Status,
- "created_time": zone.CreatedTime,
- "updated_time": zone.UpdatedTime,
- "node_ids": zone.NodeIDs,
- "auto_start": zone.AutoStart,
- "drs": zone.DRS,
- "drs_uid": zone.DRSUID,
- "drs_name": zone.DRSName,
- "sso_url": zone.SSOURL,
- "app_id": zone.AppID,
- "decort_url": zone.DecortURL,
- "ping_addr": zone.PingAddr,
- "broadcast_addr": zone.BroadcastAddr,
- "ssl_skip_verify": zone.SSLSkipVerify,
- "domain": zone.Domain,
- "sso_type": zone.SSOType,
+ "zone_id": int(zone.ID),
+ "guid": int(zone.GUID),
+ "gid": int(zone.GID),
+ "name": zone.Name,
+ "description": zone.Description,
+ "deletable": zone.Deletable,
+ "status": zone.Status,
+ "created_time": zone.CreatedTime,
+ "updated_time": zone.UpdatedTime,
+ "node_ids": zone.NodeIDs,
+ "auto_start": zone.AutoStart,
+ "drs": zone.DRS,
+ "drs_uid": zone.DRSUID,
+ "drs_name": zone.DRSName,
+ "sso_url": zone.SSOURL,
+ "app_id": zone.AppID,
+ "decort_url": zone.DecortURL,
+ "ping_addr": zone.PingAddr,
+ "broadcast_addr": zone.BroadcastAddr,
+ "ssl_skip_verify": zone.SSLSkipVerify,
+ "domain": zone.Domain,
+ "sso_type": zone.SSOType,
+ "cpu_alignment_profiles": flattenCpuAlignmentProfiles(zone.CpuAlignmentProfiles),
+ "reserved_cpu": int(zone.ReservedCPU),
+ "reserved_ram": int(zone.ReservedRAM),
}
res = append(res, temp)
}
diff --git a/internal/service/cloudbroker/account/data_source_account_audits_list.go b/internal/service/cloudbroker/account/data_source_account_audits_list.go
index 2f5e3c93..87e6ac87 100644
--- a/internal/service/cloudbroker/account/data_source_account_audits_list.go
+++ b/internal/service/cloudbroker/account/data_source_account_audits_list.go
@@ -58,6 +58,8 @@ func DataSourceAccountAuditsList() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_cb_audit_list instead.",
+
ReadContext: dataSourceAccountAuditsListRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/account/old_schemas.go b/internal/service/cloudbroker/account/old_schemas.go
new file mode 100644
index 00000000..60d7f923
--- /dev/null
+++ b/internal/service/cloudbroker/account/old_schemas.go
@@ -0,0 +1,309 @@
+package account
+
+import (
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
+)
+
+func resourceAccountV1() *schema.Resource {
+ return &schema.Resource{Schema: resourceAccountSchemaMakeV1()}
+}
+
+func resourceAccountSchemaMakeV1() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "account_name": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "account name",
+ },
+ "username": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "username of owner the account",
+ },
+ "desc": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "description",
+ },
+ "emailaddress": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "email",
+ },
+ "default_zone_id": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "email",
+ },
+ "send_access_emails": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ Description: "if true send emails when a user is granted access to resources",
+ },
+ "zone_ids": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ },
+ "uniq_pools": {
+ Type: schema.TypeList,
+ Optional: true,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ },
+ "users": {
+ Type: schema.TypeList,
+ Optional: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "user_id": {
+ Type: schema.TypeString,
+ Required: true,
+ },
+ "access_type": {
+ Type: schema.TypeString,
+ Required: true,
+ },
+ },
+ },
+ },
+ "cpu_allocation_parameter": {
+ Type: schema.TypeString,
+ Optional: true,
+ Computed: true,
+ Description: "set cpu allocation parameter",
+ },
+ "cpu_allocation_ratio": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ Description: "set cpu allocation ratio",
+ },
+ "available_templates": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ Description: "Share images with account",
+ },
+ "restore": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Description: "restore a deleted account",
+ },
+ "permanently": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: false,
+ Description: "whether to completely delete the account",
+ },
+ "enable": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ Description: "enable/disable account",
+ },
+ "resource_limits": {
+ Type: schema.TypeList,
+ Optional: true,
+ Computed: true,
+ MaxItems: 1,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "cu_c": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ },
+ "cu_d": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "cu_dm": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ },
+ "cu_i": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ },
+ "cu_m": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ },
+ "gpu_units": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ },
+ "storage_policy": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "limit": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "storage_policy": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "id": {
+ Type: schema.TypeInt,
+ Required: true,
+ },
+ "limit": {
+ Type: schema.TypeInt,
+ Required: true,
+ },
+ },
+ },
+ },
+ "compute_features": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ ValidateFunc: validation.StringInSlice([]string{"hugepages", "numa", "cpupin", "vfnic", "dpdk", "changemac", "trunk"}, true),
+ },
+ },
+ "account_id": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ },
+ "dc_location": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "acl": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "emails": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ },
+ "explicit": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "right": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "user_group_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "company": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "companyurl": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "created_by": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "created_time": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "deactivation_time": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "deleted_by": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "deleted_time": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "displayname": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "resource_types": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "updated_by": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "updated_time": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "version": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "vins": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ },
+ }
+}
diff --git a/internal/service/cloudbroker/account/resource_account.go b/internal/service/cloudbroker/account/resource_account.go
index 1756ccdf..c099f962 100644
--- a/internal/service/cloudbroker/account/resource_account.go
+++ b/internal/service/cloudbroker/account/resource_account.go
@@ -209,7 +209,7 @@ func resourceAccountCreate(ctx context.Context, d *schema.ResourceData, m interf
}
if cpuAllocationRatio, ok := d.GetOk("cpu_allocation_ratio"); ok {
- cpuAllocationRatio := cpuAllocationRatio.(float64)
+ cpuAllocationRatio := uint64(cpuAllocationRatio.(int))
req := account.SetCPUAllocationRatioRequest{
AccountID: accountId,
@@ -450,7 +450,7 @@ func resourceAccountUpdate(ctx context.Context, d *schema.ResourceData, m interf
func ResourceAccount() *schema.Resource {
return &schema.Resource{
- SchemaVersion: 1,
+ SchemaVersion: 2,
CreateContext: resourceAccountCreate,
ReadContext: resourceAccountRead,
@@ -470,5 +470,12 @@ func ResourceAccount() *schema.Resource {
},
Schema: resourceAccountSchemaMake(),
+ StateUpgraders: []schema.StateUpgrader{
+ {
+ Type: resourceAccountV1().CoreConfigSchema().ImpliedType(),
+ Upgrade: resourceAccountStateUpgradeV1,
+ Version: 1,
+ },
+ },
}
}
diff --git a/internal/service/cloudbroker/account/schema.go b/internal/service/cloudbroker/account/schema.go
index 52b52d97..423e826e 100644
--- a/internal/service/cloudbroker/account/schema.go
+++ b/internal/service/cloudbroker/account/schema.go
@@ -77,7 +77,7 @@ func resourceAccountSchemaMake() map[string]*schema.Schema {
Description: "set cpu allocation parameter",
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "set cpu allocation ratio",
@@ -596,7 +596,7 @@ func dataSourceAccountListDeletedSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"created_by": {
@@ -1342,7 +1342,7 @@ func dataSourceAccountListSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"created_by": {
@@ -2234,7 +2234,7 @@ func dataSourceAccountSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"created_by": {
diff --git a/internal/service/cloudbroker/account/state_upgraders.go b/internal/service/cloudbroker/account/state_upgraders.go
new file mode 100644
index 00000000..46f2f8c4
--- /dev/null
+++ b/internal/service/cloudbroker/account/state_upgraders.go
@@ -0,0 +1,15 @@
+package account
+
+import (
+ "context"
+
+ log "github.com/sirupsen/logrus"
+)
+
+func resourceAccountStateUpgradeV1(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
+ log.Debug("resourceAccountStateUpgradeV1: upgrading state")
+ if v, ok := rawState["cpu_allocation_ratio"]; ok && v != nil {
+ rawState["cpu_allocation_ratio"] = int(v.(float64))
+ }
+ return rawState, nil
+}
diff --git a/internal/service/cloudbroker/account/utility_account.go b/internal/service/cloudbroker/account/utility_account.go
index 8ca0b17e..ff6adc75 100644
--- a/internal/service/cloudbroker/account/utility_account.go
+++ b/internal/service/cloudbroker/account/utility_account.go
@@ -117,7 +117,7 @@ func utilityAccountCPURatioUpdate(ctx context.Context, d *schema.ResourceData, m
accountId, _ := strconv.ParseUint(d.Id(), 10, 64)
- cpuAllocacationRatio := d.Get("cpu_allocation_ratio").(float64)
+ cpuAllocacationRatio := uint64(d.Get("cpu_allocation_ratio").(int))
_, err := c.CloudBroker().Account().SetCPUAllocationRatio(ctx, account.SetCPUAllocationRatioRequest{
AccountID: accountId,
diff --git a/internal/service/cloudbroker/disks/flattens.go b/internal/service/cloudbroker/disks/flattens.go
index 05883686..6c01e934 100644
--- a/internal/service/cloudbroker/disks/flattens.go
+++ b/internal/service/cloudbroker/disks/flattens.go
@@ -13,10 +13,11 @@ func flattenDisk(d *schema.ResourceData, disk *disks.RecordDisk) {
d.Set("account_id", disk.AccountID)
d.Set("account_name", disk.AccountName)
d.Set("acl", string(diskAcl))
- d.Set("blk_discard", disk.BLKDiscard)
+ d.Set("discard", disk.Discard)
d.Set("block_size", disk.BlockSize)
d.Set("boot_partition", disk.BootPartition)
d.Set("computes", flattenDiskComputes(disk.Computes))
+ d.Set("computes_read_only", flattenDiskComputesReadOnly(disk.ComputesReadOnly))
d.Set("created_by", disk.CreatedBy)
d.Set("created_time", disk.CreatedTime)
d.Set("deleted_by", disk.DeletedBy)
@@ -157,6 +158,18 @@ func flattenDiskComputes(computes map[string]string) []map[string]interface{} {
return res
}
+func flattenDiskComputesReadOnly(computesReadOnly map[string]bool) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(computesReadOnly))
+ for computeID, readOnly := range computesReadOnly {
+ tmp := map[string]interface{}{
+ "compute_id": computeID,
+ "read_only": readOnly,
+ }
+ res = append(res, tmp)
+ }
+ return res
+}
+
func flattenIOTune(iot disks.IOTune) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
temp := map[string]interface{}{
@@ -187,10 +200,11 @@ func flattenDiskList(dl *disks.ListDisks) []map[string]interface{} {
"account_id": disk.AccountID,
"account_name": disk.AccountName,
"acl": string(diskAcl),
- "blk_discard": disk.BLKDiscard,
+ "discard": disk.Discard,
"block_size": disk.BlockSize,
"boot_partition": disk.BootPartition,
"computes": flattenDiskComputes(disk.Computes),
+ "computes_read_only": flattenDiskComputesReadOnly(disk.ComputesReadOnly),
"created_by": disk.CreatedBy,
"created_time": disk.CreatedTime,
"deleted_by": disk.DeletedBy,
@@ -255,6 +269,7 @@ func flattendDiskSnapshotList(sl disks.ListSnapshots) []interface{} {
temp := map[string]interface{}{
"guid": snapshot.GUID,
"label": snapshot.Label,
+ "pool_name": snapshot.PoolName,
"reference_id": snapshot.ReferenceID,
"res_id": snapshot.ResID,
"snap_set_guid": snapshot.SnapSetGUID,
@@ -276,7 +291,7 @@ func flattenDiskListUnattached(ul *disks.ListUnattachedDisks) []map[string]inter
"account_id": unattachedDisk.AccountID,
"account_name": unattachedDisk.AccountName,
"acl": string(unattachedDiskAcl),
- "blk_discard": unattachedDisk.BLKDiscard,
+ "discard": unattachedDisk.Discard,
"block_size": unattachedDisk.BlockSize,
"boot_partition": unattachedDisk.BootPartition,
"created_time": unattachedDisk.CreatedTime,
diff --git a/internal/service/cloudbroker/disks/old_schemas.go b/internal/service/cloudbroker/disks/old_schemas.go
index 092a7159..f9a1e751 100644
--- a/internal/service/cloudbroker/disks/old_schemas.go
+++ b/internal/service/cloudbroker/disks/old_schemas.go
@@ -5,6 +5,16 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)
+func resourceDiskV2() *schema.Resource {
+ s := resourceDiskSchemaMake()
+ s["blk_discard"] = &schema.Schema{
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: false,
+ }
+ return &schema.Resource{Schema: s}
+}
+
func resourceDiskV1() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
diff --git a/internal/service/cloudbroker/disks/resource_disk.go b/internal/service/cloudbroker/disks/resource_disk.go
index a24cc279..8ae5adb8 100644
--- a/internal/service/cloudbroker/disks/resource_disk.go
+++ b/internal/service/cloudbroker/disks/resource_disk.go
@@ -79,8 +79,8 @@ func resourceDiskCreate(ctx context.Context, d *schema.ResourceData, m interface
req.Cache = cache.(string)
}
- if blkDiscard, ok := d.GetOk("blk_discard"); ok {
- req.BLKDiscard = blkDiscard.(bool)
+ if discard, ok := d.GetOk("discard"); ok {
+ req.Discard = discard.(string)
}
diskID, err := c.CloudBroker().Disks().Create(ctx, req)
@@ -250,15 +250,15 @@ func resourceDiskUpdate(ctx context.Context, d *schema.ResourceData, m interface
}
}
- if d.HasChanges("cache", "blk_discard", "block_size") {
+ if d.HasChanges("cache", "discard", "block_size") {
updateReq := disks.UpdateRequest{
DiskID: uint64(d.Get("disk_id").(int)),
}
if d.HasChange("cache") {
updateReq.Cache = d.Get("cache").(string)
}
- if d.HasChange("blk_discard") {
- updateReq.BLKDiscard = d.Get("blk_discard").(bool)
+ if d.HasChange("discard") {
+ updateReq.Discard = d.Get("discard").(string)
}
if d.HasChange("block_size") {
updateReq.BlockSize = d.Get("block_size").(string)
@@ -460,7 +460,7 @@ func resourceDiskChangeNodes(ctx context.Context, d *schema.ResourceData, m inte
func ResourceDisk() *schema.Resource {
return &schema.Resource{
- SchemaVersion: 2,
+ SchemaVersion: 3,
CreateContext: resourceDiskCreate,
ReadContext: resourceDiskRead,
@@ -486,6 +486,11 @@ func ResourceDisk() *schema.Resource {
Upgrade: resourceDiskUpgradeV1,
Version: 1,
},
+ {
+ Type: resourceDiskV2().CoreConfigSchema().ImpliedType(),
+ Upgrade: resourceDiskUpgradeV2,
+ Version: 2,
+ },
},
}
}
diff --git a/internal/service/cloudbroker/disks/schema.go b/internal/service/cloudbroker/disks/schema.go
index 3b7f0497..2d1565c1 100644
--- a/internal/service/cloudbroker/disks/schema.go
+++ b/internal/service/cloudbroker/disks/schema.go
@@ -23,8 +23,8 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -51,6 +51,22 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_by": {
Type: schema.TypeString,
Computed: true,
@@ -327,6 +343,10 @@ func dataSourceDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"reference_id": {
Type: schema.TypeString,
Computed: true,
@@ -478,8 +498,8 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -506,6 +526,22 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_by": {
Type: schema.TypeString,
Computed: true,
@@ -786,6 +822,10 @@ func dataSourceDiskListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"reference_id": {
Type: schema.TypeString,
Computed: true,
@@ -913,8 +953,8 @@ func dataSourceDiskListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -941,6 +981,22 @@ func dataSourceDiskListDeletedSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_by": {
Type: schema.TypeString,
Computed: true,
@@ -1221,6 +1277,10 @@ func dataSourceDiskListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"reference_id": {
Type: schema.TypeString,
Computed: true,
@@ -1367,8 +1427,8 @@ func dataSourceDiskListUnattachedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "blk_discard": {
- Type: schema.TypeBool,
+ "discard": {
+ Type: schema.TypeString,
Computed: true,
},
"block_size": {
@@ -1926,10 +1986,11 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
Default: false,
Description: "restore deleting disk",
},
- "blk_discard": {
- Type: schema.TypeBool,
- Optional: true,
- Default: false,
+ "discard": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "ignore",
+ ValidateFunc: validation.StringInSlice([]string{"unmap", "ignore"}, false),
},
"block_size": {
Type: schema.TypeString,
@@ -1965,6 +2026,22 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
},
},
},
+ "computes_read_only": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ },
+ },
+ },
"created_time": {
Type: schema.TypeInt,
Computed: true,
@@ -2220,6 +2297,10 @@ func resourceDiskSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"reference_id": {
Type: schema.TypeString,
Computed: true,
@@ -2569,6 +2650,10 @@ func dataSourceDiskReplicationSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"reference_id": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudbroker/disks/state_upgrader.go b/internal/service/cloudbroker/disks/state_upgrader.go
index 50fd2672..b7bc3bf8 100644
--- a/internal/service/cloudbroker/disks/state_upgrader.go
+++ b/internal/service/cloudbroker/disks/state_upgrader.go
@@ -12,3 +12,17 @@ func resourceDiskUpgradeV1(ctx context.Context, rawState map[string]interface{},
return rawState, nil
}
+
+func resourceDiskUpgradeV2(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
+ log.Debug("resourceDiskUpgradeV2: upgrading state")
+ if v, ok := rawState["blk_discard"].(bool); ok {
+ if v {
+ rawState["discard"] = "unmap"
+ } else {
+ rawState["discard"] = "ignore"
+ }
+ }
+ delete(rawState, "blk_discard")
+
+ return rawState, nil
+}
diff --git a/internal/service/cloudbroker/extnet/flattens.go b/internal/service/cloudbroker/extnet/flattens.go
index 5894fa23..7b51276b 100644
--- a/internal/service/cloudbroker/extnet/flattens.go
+++ b/internal/service/cloudbroker/extnet/flattens.go
@@ -37,6 +37,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/extnet"
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/flattens"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/status"
)
func flattenListExtnet(extList *extnet.ListExtNet) []map[string]interface{} {
@@ -129,8 +130,10 @@ func flattenRecordExtnetResource(d *schema.ResourceData, recNet *extnet.RecordEx
d.Set("ovs_bridge", recNet.OVSBridge)
d.Set("pre_reservations_num", recNet.PreReservationsNum)
d.Set("pri_vnfdev_id", recNet.PriVNFDevID)
+ d.Set("sec_vnfdev_id", recNet.SecVNFDevID)
d.Set("shared_with", recNet.SharedWith)
d.Set("status", recNet.Status)
+ d.Set("enable", recNet.Status == status.Enabled)
d.Set("vlan_id", recNet.VLANID)
d.Set("check_ips", recNet.CheckIPs)
d.Set("dns", recNet.DNS)
@@ -146,9 +149,8 @@ func flattenRecordExtnetResource(d *schema.ResourceData, recNet *extnet.RecordEx
d.Set("routes", flattenStaticRouteList(staticRouteList))
d.Set("zone_id", recNet.ZoneID)
d.Set("enable_secgroups", recNet.EnableSecGroups)
- d.Set("sec_vnfdev_id", recNet.SecVNFDevID)
- d.Set("highly_available", recNet.Redundant)
d.Set("mtu", recNet.MTU)
+ d.Set("highly_available", recNet.Redundant)
}
func flattenExtnetExcluded(ers extnet.ListReservations) []map[string]interface{} {
diff --git a/internal/service/cloudbroker/extnet/resource_extnet.go b/internal/service/cloudbroker/extnet/resource_extnet.go
index 51ae93cc..f0a0961b 100644
--- a/internal/service/cloudbroker/extnet/resource_extnet.go
+++ b/internal/service/cloudbroker/extnet/resource_extnet.go
@@ -93,15 +93,6 @@ func resourceExtnetCreate(ctx context.Context, d *schema.ResourceData, m interfa
req.DNS = res
}
- if ntp, ok := d.GetOk("ntp"); ok {
- res := make([]string, 0)
- for _, elem := range ntp.([]interface{}) {
- res = append(res, elem.(string))
- }
-
- req.NTP = res
- }
-
if check_ips, ok := d.GetOk("check_ips"); ok {
res := make([]string, 0)
for _, elem := range check_ips.([]interface{}) {
@@ -111,9 +102,7 @@ func resourceExtnetCreate(ctx context.Context, d *schema.ResourceData, m interfa
req.CheckIPs = res
}
- if virtual, ok := d.GetOk("virtual"); ok {
- req.Virtual = virtual.(bool)
- }
+ req.Virtual = d.Get("virtual").(bool)
if zoneID, ok := d.GetOk("zone_id"); ok {
req.ZoneID = uint64(zoneID.(int))
@@ -139,9 +128,7 @@ func resourceExtnetCreate(ctx context.Context, d *schema.ResourceData, m interfa
req.OVSBridge = ovs_bridge.(string)
}
- if highly_available, ok := d.GetOk("highly_available"); ok {
- req.HAMode = highly_available.(bool)
- }
+ req.HAMode = d.Get("highly_available").(bool)
if sec_vnfdev_ip, ok := d.GetOk("sec_vnfdev_ip"); ok {
req.SecVNFDevIP = sec_vnfdev_ip.(string)
@@ -227,6 +214,12 @@ func resourceExtnetCreate(ctx context.Context, d *schema.ResourceData, m interfa
}
}
+ if _, ok := d.GetOk("ntp"); ok {
+ if err := handleNTPUpdate(ctx, d, c, &extnet.RecordExtNet{ID: netID}); err != nil {
+ w.Add(err)
+ }
+ }
+
if qos, ok := d.GetOk("default_qos"); ok && len(qos.([]interface{})) > 0 {
if err := handleDefaultQOSUpdate(ctx, d, c, &extnet.RecordExtNet{ID: netID}); err != nil {
w.Add(err)
diff --git a/internal/service/cloudbroker/extnet/schema.go b/internal/service/cloudbroker/extnet/schema.go
index 70ea2ca6..c41ca7fd 100644
--- a/internal/service/cloudbroker/extnet/schema.go
+++ b/internal/service/cloudbroker/extnet/schema.go
@@ -686,12 +686,12 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
"gid": {
Type: schema.TypeInt,
Required: true,
- Description: "Grid (platform) ID",
+ Description: "Grid platform ID",
},
"ipcidr": {
Type: schema.TypeString,
Required: true,
- // ForceNew: true,
+ // ForceNew: true,?
Description: "IP network CIDR",
ValidateFunc: validation.IsCIDR,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
@@ -724,7 +724,7 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
Type: schema.TypeBool,
Optional: true,
Default: false,
- Description: "enable security groups",
+ Description: "Enable security groups",
},
"dns": {
Type: schema.TypeList,
@@ -754,12 +754,12 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
ValidateFunc: validation.IsIPAddress,
},
- Description: "IPs to check network availability",
+ Description: "IPs checking network availability",
},
"virtual": {
Type: schema.TypeBool,
Optional: true,
- Description: "If true - platform DHCP server will not be created",
+ Description: "True disables platform DHCP server creation",
},
"desc": {
Type: schema.TypeString,
@@ -770,44 +770,44 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
"start_ip": {
Type: schema.TypeString,
Optional: true,
- Description: "Start of IP range to be explicitly included",
+ Description: "Explicitly included IP range start",
ValidateFunc: validation.IsIPAddress,
},
"end_ip": {
Type: schema.TypeString,
Optional: true,
- Description: "End of IP range to be explicitly included",
+ Description: "Explicitly included IP range end",
ValidateFunc: validation.IsIPAddress,
},
"vnfdev_ip": {
Type: schema.TypeString,
Optional: true,
- Description: "IP to create VNFDev with",
+ Description: "VNFDev creation IP",
ValidateFunc: validation.IsIPAddress,
},
"pre_reservations_num": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
- Description: "Number of pre created reservations",
+ Description: "Number of pre-created reservations",
},
"ovs_bridge": {
Type: schema.TypeString,
Optional: true,
Computed: true,
- Description: "OpenvSwith bridge name for ExtNet connection",
+ Description: "OpenvSwitch bridge name ExtNet connection",
},
"enable": {
Type: schema.TypeBool,
Optional: true,
Default: true,
- Description: "Disable/Enable extnet",
+ Description: "Toggle extnet status",
},
"set_default": {
Type: schema.TypeBool,
Optional: true,
Default: false,
- Description: "Set current extnet as default (can not be undone)",
+ Description: "Set current extnet as default permanent action",
},
"excluded_ips": {
Type: schema.TypeSet,
@@ -816,7 +816,7 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
ValidateFunc: validation.IsIPAddress,
},
- Description: "IPs to exclude in current extnet pool",
+ Description: "IPs excluded extnet pool",
},
"excluded_ips_range": {
Type: schema.TypeSet,
@@ -835,7 +835,7 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
},
},
},
- Description: "Range of IPs to exclude in current extnet pool",
+ Description: "Range of IPs excluded extnet pool",
},
"default_qos": {
Type: schema.TypeList,
@@ -869,7 +869,7 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
"restart": {
Type: schema.TypeBool,
Optional: true,
- Description: "restart extnet vnf device",
+ Description: "Restart extnet vnf device",
},
"migrate": {
Type: schema.TypeInt,
@@ -920,9 +920,10 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
ValidateFunc: validation.IsIPAddress,
},
"mtu": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ ValidateFunc: validation.IntBetween(1500, 9216),
},
"ckey": {
Type: schema.TypeString,
@@ -934,7 +935,7 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
Elem: &schema.Schema{
Type: schema.TypeString,
},
- Description: "meta",
+ Description: "Meta information",
},
"default": {
Type: schema.TypeBool,
@@ -1044,7 +1045,42 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
- "pre_reservations": {
+ "routes": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "compute_ids": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ },
+ "destination": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "gateway": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "netmask": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "route_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "reservations": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
@@ -1088,42 +1124,7 @@ func resourceExtnetSchemaMake() map[string]*schema.Schema {
},
},
},
- "routes": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "compute_ids": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- "destination": {
- Type: schema.TypeString,
- Computed: true,
- },
- "gateway": {
- Type: schema.TypeString,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "netmask": {
- Type: schema.TypeString,
- Computed: true,
- },
- "route_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "reservations": {
+ "pre_reservations": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
diff --git a/internal/service/cloudbroker/extnet/utility_extnet_resource.go b/internal/service/cloudbroker/extnet/utility_extnet_resource.go
index 67558f33..93687ce2 100644
--- a/internal/service/cloudbroker/extnet/utility_extnet_resource.go
+++ b/internal/service/cloudbroker/extnet/utility_extnet_resource.go
@@ -122,19 +122,32 @@ func handleBasicUpdate(ctx context.Context, d *schema.ResourceData, c *controlle
basiUpdateReq.MTU = uint64(d.Get("mtu").(int))
doBasicUpdate = true
}
- if d.HasChange("enable_secgroups") {
+ changingSecGroups := d.HasChange("enable_secgroups")
+ if changingSecGroups {
basiUpdateReq.EnableSecGroups = d.Get("enable_secgroups").(bool)
doBasicUpdate = true
}
- if doBasicUpdate {
- _, err := c.CloudBroker().ExtNet().Update(ctx, basiUpdateReq)
- if err != nil {
+ if !doBasicUpdate {
+ return nil
+ }
+
+ wasEnabled := changingSecGroups && recNet.Status == status.Enabled
+ if wasEnabled {
+ if _, err := c.CloudBroker().ExtNet().Disable(ctx, extnet.DisableRequest{NetID: recNet.ID}); err != nil {
return err
}
}
- return nil
+ _, err := c.CloudBroker().ExtNet().Update(ctx, basiUpdateReq)
+
+ if wasEnabled {
+ if _, enableErr := c.CloudBroker().ExtNet().Enable(ctx, extnet.EnableRequest{NetID: recNet.ID}); enableErr != nil {
+ return errors.Join(err, enableErr)
+ }
+ }
+
+ return err
}
func handleEnableUpdate(ctx context.Context, d *schema.ResourceData, c *controller.ControllerCfg, recNet *extnet.RecordExtNet) error {
diff --git a/internal/service/cloudbroker/grid/data_source_grid_list_emails.go b/internal/service/cloudbroker/grid/data_source_grid_list_emails.go
index f4106cb0..c5892ad9 100644
--- a/internal/service/cloudbroker/grid/data_source_grid_list_emails.go
+++ b/internal/service/cloudbroker/grid/data_source_grid_list_emails.go
@@ -58,6 +58,8 @@ func DataSourceGridListEmails() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0.",
+
ReadContext: dataSourceGridListEmailsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/grid/flattens.go b/internal/service/cloudbroker/grid/flattens.go
index 76246feb..76ff3c3a 100644
--- a/internal/service/cloudbroker/grid/flattens.go
+++ b/internal/service/cloudbroker/grid/flattens.go
@@ -9,8 +9,6 @@ import (
)
func flattenGrid(d *schema.ResourceData, grid *grid.RecordGrid) {
- d.Set("ckey", grid.CKey)
- d.Set("meta", flattens.FlattenMeta(grid.Meta))
d.Set("auth_broker", flattens.FlattenMeta(grid.AuthBroker))
d.Set("name", grid.Name)
d.Set("flag", grid.Flag)
@@ -19,8 +17,10 @@ func flattenGrid(d *schema.ResourceData, grid *grid.RecordGrid) {
d.Set("location_code", grid.LocationCode)
d.Set("id", grid.ID)
d.Set("network_modes", grid.NetworkModes)
+ d.Set("reserved_cpu", grid.ReservedCPU)
+ d.Set("reserved_ram", grid.ReservedRAM)
d.Set("sdn_support", grid.SDNSupport)
-
+ d.Set("zero_access_enabled", grid.ZeroAccessEnabled)
}
func flattenGridList(gl *grid.ListGrids) []map[string]interface{} {
@@ -36,8 +36,11 @@ func flattenGridList(gl *grid.ListGrids) []map[string]interface{} {
"location_code": item.LocationCode,
"id": item.ID,
"network_modes": item.NetworkModes,
+ "reserved_cpu": item.ReservedCPU,
+ "reserved_ram": item.ReservedRAM,
"sdn_support": item.SDNSupport,
"zero_access_enabled": item.ZeroAccessEnabled,
+ "bro_enabled": item.BROEnabled,
}
res = append(res, temp)
}
@@ -77,11 +80,26 @@ func flattenGridRecordResource(rr grid.RecordResource) []map[string]interface{}
"gpu": rr.GPU,
"ram": rr.RAM,
"seps": flattenGridSeps(rr.SEPs),
+ "policies": flattenGridPolicies(rr.Policies),
}
res = append(res, temp)
return res
}
+func flattenGridPolicies(policies map[string]grid.PolicyUsage) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(policies))
+ for policyID, policy := range policies {
+ temp := map[string]interface{}{
+ "policy_id": policyID,
+ "disk_size": policy.DiskSize,
+ "disk_size_max": policy.DiskSizeMax,
+ "seps": flattenGridSeps(policy.SEPs),
+ }
+ res = append(res, temp)
+ }
+ return res
+}
+
func flattenGridSeps(seps map[string]map[string]grid.DiskUsage) []map[string]interface{} {
res := make([]map[string]interface{}, 0)
for sepKey, sepVal := range seps {
@@ -106,11 +124,14 @@ func flattenGridSettings(d *schema.ResourceData, gridSettings *grid.RecordSettin
d.Set("enable_uptime_monitor", gridSettings.EnableUptimeMonitor)
d.Set("extnet_max_pre_reservations_num", gridSettings.ExtnetMaxPreReservationsNum)
d.Set("healthcheck_notifications", flattenHealthcheckNotifications(gridSettings.HealthcheckNotifications))
+ d.Set("interface_generation_scheme", gridSettings.InterfaceGenerationScheme)
d.Set("k8s_cleanup_enabled", gridSettings.K8sCleanupEnabled)
d.Set("limits", string(limits))
d.Set("location_url", gridSettings.LocationURL)
+ d.Set("mac_address_prefix", gridSettings.MACAddressPrefix)
d.Set("net_qos", flattenNetQOS(gridSettings.NetQOS))
- d.Set("networks", gridSettings.Networks)
+ d.Set("node_self_stop_timer_uptime_monitor", gridSettings.NodeSelfStopTimerUptimeMonitor)
+ d.Set("node_self_stop_uptime_monitor", gridSettings.NodeSelfStopUptimeMonitor)
d.Set("prometheus", flattenPrometheus(gridSettings.Prometheus))
d.Set("vins_max_pre_reservations_num", gridSettings.VinsMaxPreReservationsNum)
d.Set("vnfdev_mgmt_net_range", gridSettings.VnfdevMgmtNetRange)
diff --git a/internal/service/cloudbroker/grid/schema.go b/internal/service/cloudbroker/grid/schema.go
index 2dbac5cc..2bf3dac6 100644
--- a/internal/service/cloudbroker/grid/schema.go
+++ b/internal/service/cloudbroker/grid/schema.go
@@ -8,18 +8,6 @@ func dataSourceGetGridSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Required: true,
},
- "ckey": {
- Type: schema.TypeString,
- Computed: true,
- },
- "meta": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeString,
- },
- Description: "meta",
- },
"auth_broker": {
Type: schema.TypeList,
Computed: true,
@@ -58,10 +46,22 @@ func dataSourceGetGridSchemaMake() map[string]*schema.Schema {
},
Computed: true,
},
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"sdn_support": {
Type: schema.TypeBool,
Computed: true,
},
+ "zero_access_enabled": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
}
}
@@ -156,6 +156,7 @@ func dataSourceGridListSchemaMake() map[string]*schema.Schema {
},
},
},
+ "policies": gridPoliciesSchemaMake(),
},
},
},
@@ -212,6 +213,7 @@ func dataSourceGridListSchemaMake() map[string]*schema.Schema {
},
},
},
+ "policies": gridPoliciesSchemaMake(),
},
},
},
@@ -256,6 +258,14 @@ func dataSourceGridListSchemaMake() map[string]*schema.Schema {
},
Computed: true,
},
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"sdn_support": {
Type: schema.TypeBool,
Computed: true,
@@ -264,6 +274,10 @@ func dataSourceGridListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeBool,
Computed: true,
},
+ "bro_enabled": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
},
},
},
@@ -307,6 +321,53 @@ func dataSourceGridListEmailsSchemaMake() map[string]*schema.Schema {
return rets
}
+func gridPoliciesSchemaMake() *schema.Schema {
+ return &schema.Schema{
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "policy_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "disk_size": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "disk_size_max": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "seps": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "sep_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "data_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "disk_size": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "disk_size_max": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
func dataSourceGridGetConsumptionSchemaMake() map[string]*schema.Schema {
return map[string]*schema.Schema{
"grid_id": {
@@ -366,6 +427,7 @@ func dataSourceGridGetConsumptionSchemaMake() map[string]*schema.Schema {
},
},
},
+ "policies": gridPoliciesSchemaMake(),
},
},
},
@@ -422,6 +484,7 @@ func dataSourceGridGetConsumptionSchemaMake() map[string]*schema.Schema {
},
},
},
+ "policies": gridPoliciesSchemaMake(),
},
},
},
@@ -489,6 +552,7 @@ func dataSourceGridListConsumptionSchemaMake() map[string]*schema.Schema {
},
},
},
+ "policies": gridPoliciesSchemaMake(),
},
},
},
@@ -545,6 +609,7 @@ func dataSourceGridListConsumptionSchemaMake() map[string]*schema.Schema {
},
},
},
+ "policies": gridPoliciesSchemaMake(),
},
},
},
@@ -725,10 +790,6 @@ func dataSourceGridGetSettingsSchemaMake() map[string]*schema.Schema {
},
},
},
- "networks": {
- Type: schema.TypeString,
- Computed: true,
- },
"prometheus": {
Type: schema.TypeList,
Computed: true,
@@ -749,5 +810,21 @@ func dataSourceGridGetSettingsSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "interface_generation_scheme": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "mac_address_prefix": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "node_self_stop_timer_uptime_monitor": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "node_self_stop_uptime_monitor": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
}
}
diff --git a/internal/service/cloudbroker/image/flattens.go b/internal/service/cloudbroker/image/flattens.go
index 156a0537..26b4140e 100644
--- a/internal/service/cloudbroker/image/flattens.go
+++ b/internal/service/cloudbroker/image/flattens.go
@@ -138,7 +138,7 @@ func flattenImageList(il *image.ListImages) []map[string]interface{} {
"storage_policy_id": item.StoragePolicyID,
"tech_status": item.TechStatus,
"to_clean": item.ToClean,
- "image_type": item.Type,
+ "type_image": item.Type,
"url": item.URL,
"username": item.Username,
"version": item.Version,
diff --git a/internal/service/cloudbroker/image/schema.go b/internal/service/cloudbroker/image/schema.go
index c42117d3..08939a69 100644
--- a/internal/service/cloudbroker/image/schema.go
+++ b/internal/service/cloudbroker/image/schema.go
@@ -64,9 +64,10 @@ func dataSourceImageListSchemaMake() map[string]*schema.Schema {
Description: "find by architecture",
},
"type_image": {
- Type: schema.TypeString,
+ Type: schema.TypeList,
Optional: true,
Description: "find by type",
+ Elem: &schema.Schema{Type: schema.TypeString},
},
"image_size": {
Type: schema.TypeInt,
@@ -366,7 +367,7 @@ func dataSourceImageListSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "tech atatus",
},
- "image_type": {
+ "type_image": {
Type: schema.TypeString,
Computed: true,
Description: "Image type linux, windows or other",
@@ -737,9 +738,10 @@ func resourceCDROMImageSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"computeci_id": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Deprecated: "\"computeci_id\" is deprecated and will be removed in version 4.14.0",
},
"shared_with": {
Type: schema.TypeList,
@@ -1019,9 +1021,10 @@ func resourceImageSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"computeci_id": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Deprecated: "\"computeci_id\" is deprecated and will be removed in version 4.14.0",
},
"sync_mode": {
Type: schema.TypeBool,
@@ -1238,9 +1241,10 @@ func resourceVirtualImageSchemaMake() map[string]*schema.Schema {
Description: "Does this image boot OS",
},
"computeci_id": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Deprecated: "\"computeci_id\" is deprecated and will be removed in version 4.14.0",
},
"enabled": {
Type: schema.TypeBool,
@@ -1494,9 +1498,10 @@ func resourceMultiImageSchemaMake() map[string]*schema.Schema {
Description: "Does this image boot OS",
},
"computeci_id": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Deprecated: "\"computeci_id\" is deprecated and will be removed in version 4.14.0",
},
"enabled": {
Type: schema.TypeBool,
@@ -1802,9 +1807,10 @@ func resourceImageFromBlankComputeSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"computeci_id": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Deprecated: "\"computeci_id\" is deprecated and will be removed in version 4.14.0",
},
"shared_with": {
Type: schema.TypeList,
@@ -2076,9 +2082,10 @@ func resourceImageFromPlatformDiskSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"computeci_id": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Deprecated: "\"computeci_id\" is deprecated and will be removed in version 4.14.0",
},
"shared_with": {
Type: schema.TypeList,
diff --git a/internal/service/cloudbroker/image/utility_image_list.go b/internal/service/cloudbroker/image/utility_image_list.go
index 1b8cde5e..0d94e2ec 100644
--- a/internal/service/cloudbroker/image/utility_image_list.go
+++ b/internal/service/cloudbroker/image/utility_image_list.go
@@ -58,7 +58,9 @@ func utilityImageListCheckPresence(ctx context.Context, d *schema.ResourceData,
req.Status = status.(string)
}
if typeImage, ok := d.GetOk("type_image"); ok {
- req.TypeImage = typeImage.(string)
+ for _, v := range typeImage.([]interface{}) {
+ req.TypeImage = append(req.TypeImage, v.(string))
+ }
}
if imageSize, ok := d.GetOk("image_size"); ok {
req.ImageSize = uint64(imageSize.(int))
diff --git a/internal/service/cloudbroker/k8s/schema.go b/internal/service/cloudbroker/k8s/schema.go
index d6d879cb..d082c60b 100644
--- a/internal/service/cloudbroker/k8s/schema.go
+++ b/internal/service/cloudbroker/k8s/schema.go
@@ -1352,7 +1352,7 @@ func resourceK8sCPSchemaMake() map[string]*schema.Schema {
"k8sci_id": {
Type: schema.TypeInt,
Required: true,
- Description: "ID of the k8s catalog item to base this instance on.",
+ Description: "ID of the k8s catalog item to base this instance on. The maximum supported Kubernetes version is < 1.29.",
},
"network_plugin": {
Type: schema.TypeString,
@@ -1466,14 +1466,14 @@ func resourceK8sCPSchemaMake() map[string]*schema.Schema {
Optional: true,
Description: "insert ssl certificate in x509 pem format",
},
- "chipset": {
- Type: schema.TypeString,
- Optional: true,
- ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
- Default: "Q35",
- Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
- },
- "lb_sysctl_params": {
+ "chipset": {
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
+ Default: "Q35",
+ Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
+ },
+ "lb_sysctl_params": {
Type: schema.TypeList,
Optional: true,
Description: "Custom sysctl values for Load Balancer instance. Applied on boot.",
@@ -1810,19 +1810,19 @@ func resourceK8sWgSchemaMake() map[string]*schema.Schema {
),
Description: "Node RAM in MB.",
},
- "chipset": {
- Type: schema.TypeString,
- Optional: true,
- ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
- Default: "Q35",
- Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
- },
- "disk": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
- Description: "Worker node boot disk size. If unspecified or 0, size is defined by OS image size.",
- },
+ "chipset": {
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false),
+ Default: "Q35",
+ Description: "Type of the emulated system. Possible values: i440fx, Q35. Default: Q35",
+ },
+ "disk": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ Description: "Worker node boot disk size. If unspecified or 0, size is defined by OS image size.",
+ },
"labels": {
Type: schema.TypeList,
Computed: true,
diff --git a/internal/service/cloudbroker/kvmvm/data_source_compute_audits.go b/internal/service/cloudbroker/kvmvm/data_source_compute_audits.go
index 77f833d5..c15df0ca 100644
--- a/internal/service/cloudbroker/kvmvm/data_source_compute_audits.go
+++ b/internal/service/cloudbroker/kvmvm/data_source_compute_audits.go
@@ -58,6 +58,8 @@ func DataSourceComputeAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_cb_audit_list instead.",
+
ReadContext: dataSourceComputeAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/kvmvm/data_source_compute_cpu_alignment_profile.go b/internal/service/cloudbroker/kvmvm/data_source_compute_cpu_alignment_profile.go
new file mode 100644
index 00000000..4d604047
--- /dev/null
+++ b/internal/service/cloudbroker/kvmvm/data_source_compute_cpu_alignment_profile.go
@@ -0,0 +1,98 @@
+/*
+Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+Kasim Baybikov,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package kvmvm
+
+import (
+ "context"
+
+ "github.com/google/uuid"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
+)
+
+func dataSourceComputeCPUAlignmentProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
+ profile, err := utilityComputeGetCPUAlignmentProfile(ctx, d, m)
+ if err != nil {
+ d.SetId("")
+ return diag.FromErr(err)
+ }
+
+ id := uuid.New()
+ d.SetId(id.String())
+ d.Set("model", profile.Model)
+ d.Set("name", profile.Name)
+ d.Set("vendor", profile.Vendor)
+
+ return nil
+}
+
+func dataSourceComputeCPUAlignmentProfileSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "compute_id": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "ID of the compute instance",
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "CPU model of the alignment profile",
+ },
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Name of the CPU alignment profile",
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "CPU vendor of the alignment profile",
+ },
+ }
+}
+
+func DataSourceComputeCPUAlignmentProfile() *schema.Resource {
+ return &schema.Resource{
+ SchemaVersion: 1,
+
+ ReadContext: dataSourceComputeCPUAlignmentProfileRead,
+
+ Timeouts: &schema.ResourceTimeout{
+ Read: &constants.Timeout30s,
+ Default: &constants.Timeout60s,
+ },
+
+ Schema: dataSourceComputeCPUAlignmentProfileSchemaMake(),
+ }
+}
diff --git a/internal/service/cloudbroker/kvmvm/data_source_compute_get_audits.go b/internal/service/cloudbroker/kvmvm/data_source_compute_get_audits.go
index 2f10b03e..135bd956 100644
--- a/internal/service/cloudbroker/kvmvm/data_source_compute_get_audits.go
+++ b/internal/service/cloudbroker/kvmvm/data_source_compute_get_audits.go
@@ -57,6 +57,8 @@ func DataSourceComputeGetAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_cb_audit_list instead.",
+
ReadContext: dataSourceComputeGetAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/kvmvm/data_source_compute_get_log.go b/internal/service/cloudbroker/kvmvm/data_source_compute_get_log.go
index 1b7583cb..c48b1e4d 100644
--- a/internal/service/cloudbroker/kvmvm/data_source_compute_get_log.go
+++ b/internal/service/cloudbroker/kvmvm/data_source_compute_get_log.go
@@ -59,6 +59,8 @@ func DataSourceComputeGetLog() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0.",
+
ReadContext: dataSourceComputeGetLogRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/kvmvm/data_source_compute_migrate_storage_info.go b/internal/service/cloudbroker/kvmvm/data_source_compute_migrate_storage_info.go
index 6706ff4c..a2ada9fa 100644
--- a/internal/service/cloudbroker/kvmvm/data_source_compute_migrate_storage_info.go
+++ b/internal/service/cloudbroker/kvmvm/data_source_compute_migrate_storage_info.go
@@ -34,6 +34,7 @@ package kvmvm
import (
"context"
+
"github.com/google/uuid"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -49,7 +50,7 @@ func dataSourceComputeMigrateStorageInfoRead(ctx context.Context, d *schema.Reso
id := uuid.New()
d.SetId(id.String())
- d.Set("migrate_storage_info", result)
+ flattenMigrateStorageInfo(d, result)
return nil
}
diff --git a/internal/service/cloudbroker/kvmvm/flattens.go b/internal/service/cloudbroker/kvmvm/flattens.go
index a5366857..7d4e80f7 100644
--- a/internal/service/cloudbroker/kvmvm/flattens.go
+++ b/internal/service/cloudbroker/kvmvm/flattens.go
@@ -39,8 +39,10 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p
d.Set("boot_disk_id", bootDisk.ID)
// we intentionally use the SizeMax field, do not change it until the BootDiskSize field is fixed on the platform
d.Set("boot_disk_size", bootDisk.SizeMax)
+ d.Set("boot_disk_discard", bootDisk.Discard)
d.Set("boot_image_id", bootDisk.ImageID)
d.Set("chipset", computeRec.Chipset)
+ d.Set("clock", computeRec.Clock)
d.Set("cd_image_id", computeRec.CdImageId)
d.Set("clone_reference", computeRec.CloneReference)
d.Set("clones", computeRec.Clones)
@@ -85,6 +87,7 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p
d.Set("registered", computeRec.Registered)
d.Set("res_name", computeRec.ResName)
d.Set("reserved_node_cpus", computeRec.ReservedNodeCpus)
+ d.Set("resized_online", computeRec.ResizedOnline)
d.Set("rg_name", computeRec.RGName)
d.Set("rg_id", computeRec.RGID)
d.Set("snap_sets", flattenSnapSets(computeRec.SnapSets))
@@ -111,12 +114,26 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p
d.Set("zone_id", computeRec.ZoneID)
d.Set("os_version", computeRec.OSVersion)
d.Set("cpu_pin", computeRec.CPUPin)
+ d.Set("cpu_alignment_profile", computeRec.CPUAlignmentProfile.Name)
d.Set("numa_affinity", computeRec.NumaAffinity)
d.Set("hp_backed", computeRec.HPBacked)
d.Set("weight", computeRec.Weight)
return nil
}
+func flattenCPUAlignmentProfile(profile compute.CPUAlignmentProfile) []map[string]interface{} {
+ if profile.Name == "" && profile.Model == "" && profile.Vendor == "" {
+ return nil
+ }
+ return []map[string]interface{}{
+ {
+ "name": profile.Name,
+ "model": profile.Model,
+ "vendor": profile.Vendor,
+ },
+ }
+}
+
func flattenPCI(pciList compute.ListPCIDevices) []uint64 {
res := make([]uint64, 0, len(pciList.Data))
@@ -145,10 +162,11 @@ func flattenSnapSets(snaps compute.ListSnapshots) []map[string]interface{} {
for _, snap := range snaps {
res = append(res, map[string]interface{}{
- "disks": snap.Disks,
- "guid": snap.GUID,
- "label": snap.Label,
- "timestamp": snap.Timestamp,
+ "disks": snap.Disks,
+ "guid": snap.GUID,
+ "label": snap.Label,
+ "timestamp": snap.Timestamp,
+ "memory_dump_image": snap.MemoryDumpImage,
})
}
@@ -174,32 +192,33 @@ func flattenInterfaces(ifaces compute.ListInterfaces) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(ifaces))
for _, iface := range ifaces {
res = append(res, map[string]interface{}{
- "bus_number": iface.BusNumber,
- "conn_id": iface.ConnID,
- "conn_type": iface.ConnType,
- "def_gw": iface.DefGW,
- "enabled": iface.Enabled,
- "enable_secgroups": iface.EnableSecGroups,
- "flip_group_id": iface.FLIPGroupID,
- "guid": iface.GUID,
- "ip_address": iface.IPAddress,
- "listen_ssh": iface.ListenSSH,
- "mac": iface.MAC,
- "mtu": iface.MTU,
- "name": iface.Name,
- "net_id": iface.NetID,
- "netmask": iface.NetMask,
- "net_type": iface.NetType,
- "node_id": iface.NodeID,
- "pci_slot": iface.PCISlot,
- "qos": flattenQOS(iface.QOS),
- "sdn_interface_id": iface.SDNInterfaceID,
- "security_groups": iface.SecGroups,
- "target": iface.Target,
- "type": iface.Type,
- "trunk_tags": iface.TrunkTags,
- "vnfs": iface.VNFs,
- "libvirt_settings": flattenLibvirtSettings(iface.LibvirtSettings),
+ "bus_number": iface.BusNumber,
+ "conn_id": iface.ConnID,
+ "conn_type": iface.ConnType,
+ "def_gw": iface.DefGW,
+ "enabled": iface.Enabled,
+ "enable_secgroups": iface.EnableSecGroups,
+ "enable_default_gateway": iface.EnableDefaultGateway,
+ "flip_group_id": iface.FLIPGroupID,
+ "guid": iface.GUID,
+ "ip_address": iface.IPAddress,
+ "listen_ssh": iface.ListenSSH,
+ "mac": iface.MAC,
+ "mtu": iface.MTU,
+ "name": iface.Name,
+ "net_id": iface.NetID,
+ "netmask": iface.NetMask,
+ "net_type": iface.NetType,
+ "node_id": iface.NodeID,
+ "pci_slot": iface.PCISlot,
+ "qos": flattenQOS(iface.QOS),
+ "sdn_interface_id": iface.SDNInterfaceID,
+ "security_groups": iface.SecGroups,
+ "target": iface.Target,
+ "type": iface.Type,
+ "trunk_tags": iface.TrunkTags,
+ "vnfs": iface.VNFs,
+ "libvirt_settings": flattenLibvirtSettings(iface.LibvirtSettings),
})
}
return res
@@ -273,6 +292,7 @@ func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks []
"pci_slot": disk.PCISlot,
"bus_number": disk.BusNumber,
"pool": disk.Pool,
+ "read_only": disk.ReadOnly,
"desc": disk.Description,
"image_id": disk.ImageID,
"independent": disk.Independent,
@@ -291,7 +311,7 @@ func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks []
"delete_time": disk.DeletedTime,
"update_time": disk.UpdatedTime,
"cache": disk.Cache,
- "blk_discard": disk.BLKDiscard,
+ "discard": disk.Discard,
"block_size": disk.BlockSize,
"provision": disk.Provision,
"iotune": flattenIOTune(disk.IOTune),
@@ -346,6 +366,7 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
"arch": computeItem.Arch,
"auto_start_w_node": computeItem.AutoStart,
"chipset": computeItem.Chipset,
+ "clock": computeItem.Clock,
"cd_image_id": computeItem.CdImageId,
"boot_order": computeItem.BootOrder,
"boot_image_id": computeItem.BootImageID,
@@ -367,6 +388,7 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
"guid": computeItem.GUID,
"hp_backed": computeItem.HPBacked,
"compute_id": computeItem.ID,
+ "cpu_alignment_profiles": flattenCPUAlignmentProfile(computeItem.CPUAlignmentProfile),
"cpu_pin": computeItem.CPUPin,
"interfaces": flattenInterfaces(computeItem.Interfaces),
"live_migration_job_id": computeItem.LiveMigrationJobID,
@@ -390,6 +412,7 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
"registered": computeItem.Registered,
"res_name": computeItem.ResName,
"reserved_node_cpus": computeItem.ReservedNodeCpus,
+ "resized_online": computeItem.ResizedOnline,
"rg_id": computeItem.RGID,
"rg_name": computeItem.RGName,
"snap_sets": flattenSnapSets(computeItem.SnapSets),
@@ -438,6 +461,7 @@ func flattenDeletedComputeList(computes *compute.ListDeletedComputes) []map[stri
"arch": computeItem.Arch,
"auto_start_w_node": computeItem.AutoStart,
"chipset": computeItem.Chipset,
+ "clock": computeItem.Clock,
"cd_image_id": computeItem.CdImageId,
"boot_order": computeItem.BootOrder,
"bootdisk_size": computeItem.BootDiskSize,
@@ -459,6 +483,7 @@ func flattenDeletedComputeList(computes *compute.ListDeletedComputes) []map[stri
"guid": computeItem.GUID,
"hp_backed": computeItem.HPBacked,
"compute_id": computeItem.ID,
+ "cpu_alignment_profiles": flattenCPUAlignmentProfile(computeItem.CPUAlignmentProfile),
"cpu_pin": computeItem.CPUPin,
"interfaces": flattenInterfaces(computeItem.Interfaces),
"lock_status": computeItem.LockStatus,
@@ -479,6 +504,7 @@ func flattenDeletedComputeList(computes *compute.ListDeletedComputes) []map[stri
"registered": computeItem.Registered,
"res_name": computeItem.ResName,
"reserved_node_cpus": computeItem.ReservedNodeCpus,
+ "resized_online": computeItem.ResizedOnline,
"rg_id": computeItem.RGID,
"rg_name": computeItem.RGName,
"snap_sets": flattenSnapSets(computeItem.SnapSets),
@@ -580,7 +606,8 @@ func flattenDisks(disks []compute.InfoDisk) []map[string]interface{} {
// "bus_number": disk.BusNumber,
"disk_id": disk.ID,
// "pci_slot": disk.PCISlot,
- "sep_id": disk.SepID,
+ "sep_id": disk.SepID,
+ "read_only": disk.ReadOnly,
}
res = append(res, temp)
}
@@ -779,10 +806,12 @@ func flattenDataCompute(d *schema.ResourceData, compFacts *compute.RecordCompute
d.Set("boot_order", compFacts.BootOrder)
d.Set("boot_image_id", compFacts.ImageID)
d.Set("chipset", compFacts.Chipset)
+ d.Set("clock", compFacts.Clock)
d.Set("cd_image_id", compFacts.CdImageId)
d.Set("clone_reference", compFacts.CloneReference)
d.Set("clones", compFacts.Clones)
d.Set("computeci_id", compFacts.ComputeCIID)
+ d.Set("cpu_alignment_profiles", flattenCPUAlignmentProfile(compFacts.CPUAlignmentProfile))
d.Set("cpu_pin", compFacts.CPUPin)
d.Set("cpus", compFacts.CPUs)
d.Set("created_by", compFacts.CreatedBy)
@@ -824,6 +853,7 @@ func flattenDataCompute(d *schema.ResourceData, compFacts *compute.RecordCompute
d.Set("registered", compFacts.Registered)
d.Set("res_name", compFacts.ResName)
d.Set("reserved_node_cpus", compFacts.ReservedNodeCpus)
+ d.Set("resized_online", compFacts.ResizedOnline)
d.Set("rg_id", compFacts.RGID)
d.Set("rg_name", compFacts.RGName)
d.Set("snap_sets", flattenSnapSets(compFacts.SnapSets))
@@ -882,6 +912,7 @@ func parseComputeInterfacesToNetworks(networks []interface{}, ifaces compute.Lis
elem["sdn_interface_id"] = value.SDNInterfaceID
elem["weight"] = flattenNetworkWeight(networks, value.NetID, value.NetType)
elem["enabled"] = value.Enabled
+ elem["enable_default_gateway"] = value.EnableDefaultGateway
result = append(result, elem)
}
@@ -907,7 +938,7 @@ func flattenDisk(diskList compute.ListDisks) []map[string]interface{} {
"ckey": disk.CKey,
"meta": flattens.FlattenMeta(disk.Meta),
"account_id": disk.AccountID,
- "blk_discard": disk.BLKDiscard,
+ "discard": disk.Discard,
"block_size": disk.BlockSize,
"boot_partition": disk.BootPartition,
"bus_number": disk.BusNumber,
@@ -957,6 +988,7 @@ func flattenDisk(diskList compute.ListDisks) []map[string]interface{} {
"to_clean": disk.ToClean,
"provision": disk.Provision,
"updated_time": disk.UpdatedTime,
+ "read_only": disk.ReadOnly,
}
res = append(res, temp)
}
@@ -1005,6 +1037,7 @@ func flattendDiskSnapshotList(sl compute.ListDetailedSnapshots) []interface{} {
temp := map[string]interface{}{
"guid": snapshot.GUID,
"label": snapshot.Label,
+ "pool_name": snapshot.PoolName,
"res_id": snapshot.ResID,
"snap_set_guid": snapshot.SnapSetGUID,
"snap_set_time": snapshot.SnapSetTime,
@@ -1063,3 +1096,193 @@ func flattenQemuQuest(qemuQuest compute.QemuQuest) []map[string]interface{} {
return res
}
+
+func flattenMigrateStorageInfo(d *schema.ResourceData, info *compute.RecordMigrateStorageInfo) {
+ d.Set("completed", info.Completed)
+ d.Set("cpu_set", info.CPUSet)
+ d.Set("daemon_addr", info.DaemonAddr)
+ d.Set("domain_name", info.DomainName)
+ d.Set("domain_uuid", info.DomainUUID)
+ d.Set("elapsed_time", info.ElapsedTime)
+ d.Set("gid", info.GID)
+ d.Set("guid", info.GUID)
+ d.Set("migration_id", info.ID)
+ d.Set("interfaces", flattenShadowComputeInterfaces(info.Interfaces))
+ d.Set("log", info.Log)
+ d.Set("new_disk_xmls", info.NewDiskXmls)
+ d.Set("new_disks", info.NewDisks)
+ d.Set("old_disks", info.OldDisks)
+ d.Set("pid", info.PID)
+ d.Set("source_node_id", info.SourceNodeID)
+ d.Set("source_numa_node_id", info.SourceNumaNodeID)
+ d.Set("source_reserved_node_cpus", info.SourceReservedNodeCpus)
+ d.Set("source_url", info.SourceURL)
+ d.Set("status", info.Status)
+ d.Set("target_shadow_compute", flattenShadowCompute(info.TargetShadowCompute))
+ d.Set("target_node_id", info.TargetNodeID)
+ d.Set("target_url", info.TargetURL)
+ d.Set("vmlog_dir", info.VMLogDir)
+}
+
+func flattenShadowCompute(sc compute.ShadowCompute) []map[string]interface{} {
+ customFields, _ := json.Marshal(sc.CustomFields)
+ devices, _ := json.Marshal(sc.Devices)
+ userData, _ := json.Marshal(sc.Userdata)
+
+ return []map[string]interface{}{
+ {
+ "account_id": sc.AccountID,
+ "acl": flattenListACLInterface(sc.ACL),
+ "affinity_label": sc.AffinityLabel,
+ "affinity_rules": flattenShadowComputeRules(sc.AffinityRules),
+ "affinity_weight": sc.AffinityWeight,
+ "anti_affinity_rules": flattenShadowComputeRules(sc.AntiAffinityRules),
+ "arch": sc.Arch,
+ "auto_start": sc.AutoStart,
+ "boot_image_id": sc.BootImageID,
+ "boot_order": sc.BootOrder,
+ "boot_type": sc.BootType,
+ "bootdisk_size": sc.BootDiskSize,
+ "cd_image_id": sc.CDImageID,
+ "chipset": sc.Chipset,
+ "clock": sc.Clock,
+ "clone_reference": sc.CloneReference,
+ "clones": sc.Clones,
+ "computeci_id": sc.ComputeCIID,
+ "cpu_alignment_profile": flattenCPUAlignmentProfile(sc.CPUAlignmentProfile),
+ "cpupin": sc.CPUPin,
+ "cpus": sc.CPUs,
+ "custom_fields": string(customFields),
+ "desc": sc.Description,
+ "devices": string(devices),
+ "disks": flattenShadowComputeDisks(sc.Disks),
+ "driver": sc.Driver,
+ "gid": sc.GID,
+ "guid": sc.GUID,
+ "hp_backed": sc.HPBacked,
+ "hot_resize": sc.HotResize,
+ "id": sc.ID,
+ "interfaces": flattenShadowComputeInterfaces(sc.Interfaces),
+ "live_migration_job_id": sc.LiveMigrationJobID,
+ "loader_type": sc.LoaderType,
+ "lock_status": sc.LockStatus,
+ "manager_id": sc.ManagerID,
+ "manager_type": sc.ManagerType,
+ "migrationjob": sc.MigrationJob,
+ "milestones": sc.Milestones,
+ "name": sc.Name,
+ "need_reboot": sc.NeedReboot,
+ "network_interface_naming": sc.NetworkInterfaceNaming,
+ "node_id": sc.NodeID,
+ "numa_affinity": sc.NumaAffinity,
+ "numa_node_id": sc.NumaNodeID,
+ "os_users": flattenOSUsers(sc.OSUsers),
+ "os_version": sc.OSVersion,
+ "pinned_to_node": sc.PinnedToNode,
+ "preferred_cpu": sc.PreferredCPU,
+ "qemu_guest": flattenQemuQuest(sc.QemuGuest),
+ "read_only": sc.ReadOnly,
+ "ram": sc.RAM,
+ "reference_id": sc.ReferenceID,
+ "reserved_node_cpus": sc.ReservedNodeCpus,
+ "resized_online": sc.ResizedOnline,
+ "res_name": sc.ResName,
+ "rg_id": sc.RGID,
+ "snap_sets": flattenShadowComputeSnapshots(sc.SnapSets),
+ "stateless_sep_id": sc.StatelessSEPID,
+ "stateless_sep_type": sc.StatelessSEPType,
+ "status": sc.Status,
+ "tags": flattenTags(sc.Tags),
+ "tech_status": sc.TechStatus,
+ "user_managed": sc.UserManaged,
+ "userdata": string(userData),
+ "vgpus": sc.VGPUs,
+ "vnc_passwd": sc.VNCPassword,
+ "weight": sc.Weight,
+ "zone_id": sc.ZoneID,
+ },
+ }
+}
+
+func flattenShadowComputeDisks(disks []compute.ItemShadowComputeDisk) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(disks))
+
+ for _, disk := range disks {
+ res = append(res, map[string]interface{}{
+ "id": disk.ID,
+ })
+ }
+
+ return res
+}
+
+func flattenShadowComputeInterfaces(ifaces []compute.ItemShadowComputeInterface) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(ifaces))
+
+ for _, iface := range ifaces {
+ res = append(res, map[string]interface{}{
+ "name": iface.Name,
+ "target": iface.Target,
+ "pci_slot": iface.PCISlot,
+ "bus_number": iface.BusNumber,
+ "mac": iface.MAC,
+ "mtu": iface.MTU,
+ "type": iface.Type,
+ "conn_type": iface.ConnType,
+ "conn_id": iface.ConnID,
+ "flip_group_id": iface.FLIPGroupID,
+ "net_type": iface.NetType,
+ "net_id": iface.NetID,
+ "ip_address": iface.IPAddress,
+ "net_mask": iface.NetMask,
+ "def_gw": iface.DefGW,
+ "vnfs": iface.VNFs,
+ "qos": flattenQOS(iface.QOS),
+ "libvirt_settings": flattenLibvirtSettings(iface.LibvirtSettings),
+ "guid": iface.GUID,
+ "listen_ssh": iface.ListenSSH,
+ "enabled": iface.Enabled,
+ "enable_default_gateway": iface.EnableDefaultGateway,
+ "node_id": iface.NodeID,
+ "sdn_interface_id": iface.SDNInterfaceID,
+ "security_groups": iface.SecGroups,
+ "enable_secgroups": iface.EnableSecGroups,
+ "trunk_tags": iface.TrunkTags,
+ })
+ }
+
+ return res
+}
+
+// no guid
+func flattenShadowComputeRules(rules compute.ListShadowComputeRules) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(rules))
+
+ for _, rule := range rules {
+ res = append(res, map[string]interface{}{
+ "key": rule.Key,
+ "mode": rule.Mode,
+ "policy": rule.Policy,
+ "topology": rule.Topology,
+ "value": rule.Value,
+ })
+ }
+
+ return res
+}
+
+// no compute/memory_dump_image
+func flattenShadowComputeSnapshots(snaps compute.ListShadowComputeSnapshots) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(snaps))
+
+ for _, snap := range snaps {
+ res = append(res, map[string]interface{}{
+ "disks": snap.Disks,
+ "guid": snap.GUID,
+ "label": snap.Label,
+ "timestamp": snap.Timestamp,
+ })
+ }
+
+ return res
+}
diff --git a/internal/service/cloudbroker/kvmvm/old_schemas.go b/internal/service/cloudbroker/kvmvm/old_schemas.go
index 183a95c3..0ad2edc8 100644
--- a/internal/service/cloudbroker/kvmvm/old_schemas.go
+++ b/internal/service/cloudbroker/kvmvm/old_schemas.go
@@ -1058,3 +1058,20 @@ func resourceComputeResourceV1() *schema.Resource {
},
}
}
+
+func resourceComputeResourceV2() *schema.Resource {
+ s := resourceComputeSchemaMake()
+ // Add blk_discard
+ s["disks"].Elem.(*schema.Resource).Schema["blk_discard"] = &schema.Schema{
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: false,
+ }
+ // Add boot_disk_blk_discard
+ s["boot_disk_blk_discard"] = &schema.Schema{
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: false,
+ }
+ return &schema.Resource{Schema: s}
+}
diff --git a/internal/service/cloudbroker/kvmvm/resource_compute.go b/internal/service/cloudbroker/kvmvm/resource_compute.go
index ea74cd2d..42e33d80 100644
--- a/internal/service/cloudbroker/kvmvm/resource_compute.go
+++ b/internal/service/cloudbroker/kvmvm/resource_compute.go
@@ -89,12 +89,10 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
createReqX86.ZoneID = uint64(zoneID.(int))
}
- if bootDiskBLKDiscard, ok := d.GetOk("boot_disk_blk_discard"); ok {
- createReqX86.BootDiskBLKDiscard = bootDiskBLKDiscard.(bool)
+ if bootDiskDiscard, ok := d.GetOk("boot_disk_discard"); ok {
+ createReqX86.BootDiskDiscard = bootDiskDiscard.(string)
}
- createReqX86.Interfaces = make([]kvmx86.Interface, 0)
-
if networks, ok := d.GetOk("network"); ok {
if networks.(*schema.Set).Len() > 0 {
ns := networks.(*schema.Set).List()
@@ -122,6 +120,10 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
reqInterface.Enabled = netInterfaceVal["enabled"].(bool)
}
+ if reqInterface.NetType == "VINS" {
+ reqInterface.EnableDefaultGateway = netInterfaceVal["enable_default_gateway"].(bool)
+ }
+
if reqInterface.NetType == "DPDK" || reqInterface.NetType == "EXTNET" || reqInterface.NetType == "TRUNK" {
reqInterface.MTU = uint64(netInterfaceVal["mtu"].(int))
}
@@ -179,8 +181,8 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
if cache, ok := diskVal["cache"]; ok {
reqDataDisk.Cache = cache.(string)
}
- if blkDiscard, ok := diskVal["blk_discard"]; ok {
- reqDataDisk.BLKDiscard = blkDiscard.(bool)
+ if discard, ok := diskVal["discard"]; ok {
+ reqDataDisk.Discard = discard.(string)
}
disksX86 = append(disksX86, reqDataDisk)
}
@@ -227,6 +229,9 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
createReqX86.CPUPin = d.Get("cpu_pin").(bool)
createReqX86.HPBacked = d.Get("hp_backed").(bool)
createReqX86.Chipset = d.Get("chipset").(string)
+ if clock, ok := d.GetOk("clock"); ok {
+ createReqX86.Clock = clock.(string)
+ }
if preferredCPU, ok := d.GetOk("preferred_cpu"); ok {
preferredList := preferredCPU.([]interface{})
@@ -527,6 +532,17 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
}
}
+ if profileName, ok := d.GetOk("cpu_alignment_profile"); ok {
+ req := compute.SetCPUAlignmentProfileRequest{
+ ComputeIDs: []int64{int64(computeId)},
+ CPUAlignmentProfile: profileName.(string),
+ }
+ _, err := c.CloudBroker().Compute().SetCPUAlignmentProfile(ctx, req)
+ if err != nil {
+ warnings.Add(err)
+ }
+ }
+
if ars, ok := d.GetOk("affinity_rules"); ok {
log.Debugf("resourceComputeCreate: Create affinity rules on ComputeID: %d", computeId)
addedAR := ars.([]interface{})
@@ -872,8 +888,8 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
}
}
- if d.HasChange("boot_disk_blk_discard") {
- if err := utilityComputeUpdateBootDiskBLKDiscard(ctx, d, m); err != nil {
+ if d.HasChange("boot_disk_discard") {
+ if err := utilityComputeUpdateBootDiskDiscard(ctx, d, m); err != nil {
return diag.FromErr(err)
}
}
@@ -893,6 +909,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
if d.HasChanges("description",
"name",
+ "clock",
"numa_affinity",
"cpu_pin",
"hp_backed",
@@ -1026,6 +1043,12 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
}
}
+ if d.HasChange("cpu_alignment_profile") {
+ if err := utilityComputeUpdateCPUAlignmentProfile(ctx, d, m); err != nil {
+ return diag.FromErr(err)
+ }
+ }
+
return append(resourceComputeRead(ctx, d, m), warnings.Get()...)
}
@@ -1057,7 +1080,7 @@ func resourceComputeDelete(ctx context.Context, d *schema.ResourceData, m interf
func ResourceCompute() *schema.Resource {
return &schema.Resource{
- SchemaVersion: 2,
+ SchemaVersion: 3,
CustomizeDiff: func(ctx context.Context, diff *schema.ResourceDiff, i interface{}) error {
if diff.HasChanges() || diff.HasChanges("chipset", "pin_to_node", "auto_start_w_node", "libvirt_settings", "network", "affinity_rules", "anti_affinity_rules",
@@ -1100,6 +1123,11 @@ func ResourceCompute() *schema.Resource {
Upgrade: resourceCompueteStateUpgradeV1,
Version: 1,
},
+ {
+ Type: resourceComputeResourceV2().CoreConfigSchema().ImpliedType(),
+ Upgrade: resourceComputeStateUpgradeV2,
+ Version: 2,
+ },
},
}
}
diff --git a/internal/service/cloudbroker/kvmvm/schema.go b/internal/service/cloudbroker/kvmvm/schema.go
index cc3b4e11..ae1d9693 100644
--- a/internal/service/cloudbroker/kvmvm/schema.go
+++ b/internal/service/cloudbroker/kvmvm/schema.go
@@ -8,6 +8,251 @@ import (
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/validators"
)
+func QemuGuestSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "enabled": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "enabled_agent_features": {
+ Type: schema.TypeList,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "last_update": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "user": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ }
+}
+
+func CpuAlignmentProfileSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ }
+}
+
+func interfaceSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "bus_number": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "conn_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "conn_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "def_gw": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "enabled": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "enable_secgroups": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "flip_group_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "ip_address": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "listen_ssh": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "mac": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "mtu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "net_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "netmask": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "net_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "pci_slot": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "qos": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: qosSchemaMake(),
+ },
+ },
+ "libvirt_settings": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: libvirtSettingsSchemaMake(),
+ },
+ },
+ "target": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "trunk_tags": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "sdn_interface_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "security_groups": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ },
+ "vnfs": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ },
+ }
+}
+
+func qosSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "e_rate": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "in_brust": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "in_rate": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ }
+}
+
+func libvirtSettingsSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "txmode": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "ioeventfd": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "event_idx": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "queues": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "rx_queue_size": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "tx_queue_size": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ }
+}
+
+func listOsUsersSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "login": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "password": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "public_key": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ }
+}
+
func dataSourceComputeSchemaMake() map[string]*schema.Schema {
res := map[string]*schema.Schema{
"compute_id": {
@@ -153,6 +398,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "clock": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"cd_image_id": {
Type: schema.TypeInt,
Computed: true,
@@ -172,6 +421,13 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: CpuAlignmentProfileSchemaMake(),
+ },
+ },
"cpu_pin": {
Type: schema.TypeBool,
Computed: true,
@@ -228,7 +484,11 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
- "blk_discard": {
+ "discard": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "read_only": {
Type: schema.TypeBool,
Computed: true,
},
@@ -511,6 +771,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "pool_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"res_id": {
Type: schema.TypeString,
Computed: true,
@@ -608,171 +872,7 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "bus_number": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "def_gw": {
- Type: schema.TypeString,
- Computed: true,
- },
- "enabled": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "enable_secgroups": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "flip_group_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ip_address": {
- Type: schema.TypeString,
- Computed: true,
- },
- "listen_ssh": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "mac": {
- Type: schema.TypeString,
- Computed: true,
- },
- "mtu": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- },
- "net_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "netmask": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "net_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "node_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "pci_slot": {
- Type: schema.TypeInt,
- Computed: true,
- },
-
- "qos": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "e_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "in_brust": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "in_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "libvirt_settings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "txmode": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ioeventfd": {
- Type: schema.TypeString,
- Computed: true,
- },
- "event_idx": {
- Type: schema.TypeString,
- Computed: true,
- },
- "queues": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "rx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "tx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "target": {
- Type: schema.TypeString,
- Computed: true,
- },
- "type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "trunk_tags": {
- Type: schema.TypeString,
- Computed: true,
- },
- "sdn_interface_id": {
- Type: schema.TypeString,
- Computed: true,
- },
- "security_groups": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- "vnfs": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- },
+ Schema: interfaceSchemaMake(),
},
},
"live_migration_job_id": {
@@ -839,24 +939,7 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "login": {
- Type: schema.TypeString,
- Computed: true,
- },
- "password": {
- Type: schema.TypeString,
- Computed: true,
- },
- "public_key": {
- Type: schema.TypeString,
- Computed: true,
- },
- },
+ Schema: listOsUsersSchemaMake(),
},
},
"os_version": {
@@ -875,35 +958,11 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
},
},
"qemu_guest": {
- Type: schema.TypeList,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "enabled": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "enabled_agent_features": {
- Type: schema.TypeList,
- Elem: &schema.Schema{
- Type: schema.TypeString,
- },
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "last_update": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "user": {
- Type: schema.TypeString,
- Computed: true,
- },
- },
- },
+ Type: schema.TypeList,
Computed: true,
+ Elem: &schema.Resource{
+ Schema: QemuGuestSchemaMake(),
+ },
},
"ram": {
Type: schema.TypeInt,
@@ -928,6 +987,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
},
},
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"rg_id": {
Type: schema.TypeInt,
Computed: true,
@@ -960,6 +1023,10 @@ func dataSourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "memory_dump_image": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
},
},
},
@@ -1413,6 +1480,10 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "clock": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"cd_image_id": {
Type: schema.TypeInt,
Computed: true,
@@ -1432,6 +1503,13 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: CpuAlignmentProfileSchemaMake(),
+ },
+ },
"cpu_pin": {
Type: schema.TypeBool,
Computed: true,
@@ -1489,6 +1567,10 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
},
},
},
@@ -1516,170 +1598,7 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "bus_number": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "def_gw": {
- Type: schema.TypeString,
- Computed: true,
- },
- "enabled": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "enable_secgroups": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "flip_group_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ip_address": {
- Type: schema.TypeString,
- Computed: true,
- },
- "listen_ssh": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "mac": {
- Type: schema.TypeString,
- Computed: true,
- },
- "mtu": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- },
- "net_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "netmask": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "net_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "node_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "pci_slot": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "qos": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "e_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "in_brust": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "in_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "libvirt_settings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "txmode": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ioeventfd": {
- Type: schema.TypeString,
- Computed: true,
- },
- "event_idx": {
- Type: schema.TypeString,
- Computed: true,
- },
- "queues": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "rx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "tx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "sdn_interface_id": {
- Type: schema.TypeString,
- Computed: true,
- },
- "security_groups": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- "target": {
- Type: schema.TypeString,
- Computed: true,
- },
- "type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "trunk_tags": {
- Type: schema.TypeString,
- Computed: true,
- },
- "vnfs": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- },
+ Schema: interfaceSchemaMake(),
},
},
"live_migration_job_id": {
@@ -1730,24 +1649,7 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "login": {
- Type: schema.TypeString,
- Computed: true,
- },
- "password": {
- Type: schema.TypeString,
- Computed: true,
- },
- "public_key": {
- Type: schema.TypeString,
- Computed: true,
- },
- },
+ Schema: listOsUsersSchemaMake(),
},
},
"os_version": {
@@ -1766,35 +1668,11 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
},
},
"qemu_guest": {
- Type: schema.TypeList,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "enabled": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "enabled_agent_features": {
- Type: schema.TypeList,
- Elem: &schema.Schema{
- Type: schema.TypeString,
- },
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "last_update": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "user": {
- Type: schema.TypeString,
- Computed: true,
- },
- },
- },
+ Type: schema.TypeList,
Computed: true,
+ Elem: &schema.Resource{
+ Schema: QemuGuestSchemaMake(),
+ },
},
"ram": {
Type: schema.TypeInt,
@@ -1819,6 +1697,10 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
},
},
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"rg_id": {
Type: schema.TypeInt,
Computed: true,
@@ -1851,6 +1733,10 @@ func dataSourceComputeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "memory_dump_image": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
},
},
},
@@ -2177,6 +2063,10 @@ func dataSourceComputeListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "clock": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"cd_image_id": {
Type: schema.TypeInt,
Computed: true,
@@ -2196,6 +2086,13 @@ func dataSourceComputeListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: CpuAlignmentProfileSchemaMake(),
+ },
+ },
"cpu_pin": {
Type: schema.TypeBool,
Computed: true,
@@ -2249,6 +2146,10 @@ func dataSourceComputeListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
},
},
},
@@ -2276,170 +2177,7 @@ func dataSourceComputeListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "bus_number": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "def_gw": {
- Type: schema.TypeString,
- Computed: true,
- },
- "enabled": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "enable_secgroups": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "flip_group_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ip_address": {
- Type: schema.TypeString,
- Computed: true,
- },
- "listen_ssh": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "mac": {
- Type: schema.TypeString,
- Computed: true,
- },
- "mtu": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- },
- "net_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "netmask": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "net_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "node_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "pci_slot": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "qos": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "e_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "in_brust": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "in_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "libvirt_settings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "txmode": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ioeventfd": {
- Type: schema.TypeString,
- Computed: true,
- },
- "event_idx": {
- Type: schema.TypeString,
- Computed: true,
- },
- "queues": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "rx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "tx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "sdn_interface_id": {
- Type: schema.TypeString,
- Computed: true,
- },
- "security_groups": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- "target": {
- Type: schema.TypeString,
- Computed: true,
- },
- "type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "trunk_tags": {
- Type: schema.TypeString,
- Computed: true,
- },
- "vnfs": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- },
+ Schema: interfaceSchemaMake(),
},
},
"lock_status": {
@@ -2482,24 +2220,7 @@ func dataSourceComputeListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "login": {
- Type: schema.TypeString,
- Computed: true,
- },
- "password": {
- Type: schema.TypeString,
- Computed: true,
- },
- "public_key": {
- Type: schema.TypeString,
- Computed: true,
- },
- },
+ Schema: listOsUsersSchemaMake(),
},
},
"os_version": {
@@ -2540,6 +2261,10 @@ func dataSourceComputeListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
},
},
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"rg_id": {
Type: schema.TypeInt,
Computed: true,
@@ -2572,6 +2297,10 @@ func dataSourceComputeListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "memory_dump_image": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
},
},
},
@@ -3072,18 +2801,657 @@ func dataSourceComputeBootOrderGetSchemaMake() map[string]*schema.Schema {
}
func dataSourceComputeMigrateStorageInfoSchemaMake() map[string]*schema.Schema {
- res := map[string]*schema.Schema{
+ return map[string]*schema.Schema{
"compute_id": {
Type: schema.TypeInt,
Required: true,
},
- "migrate_storage_info": {
+ "completed": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "cpu_set": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "daemon_addr": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "domain_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "domain_uuid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "elapsed_time": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "gid": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "migration_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "interfaces": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: itemShadowComputeInterfaceSchemaMake(),
+ },
+ },
+ "log": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ "new_disk_xmls": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ "new_disks": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "old_disks": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "pid": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "source_node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "source_numa_node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "source_reserved_node_cpus": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "source_url": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "target_shadow_compute": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: shadowComputeSchemaMake(),
+ },
+ },
+ "target_node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "target_url": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vmlog_dir": {
Type: schema.TypeString,
Computed: true,
},
}
- return res
+}
+
+func shadowComputeSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "account_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "acl": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "explicit": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "right": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "user_group_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "affinity_label": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "affinity_rules": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "key": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "mode": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "policy": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "topology": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "value": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "affinity_weight": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "anti_affinity_rules": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "key": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "mode": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "policy": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "topology": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "value": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "arch": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "auto_start": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "boot_image_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "boot_order": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ "boot_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "bootdisk_size": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "cd_image_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "chipset": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "clock": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "clone_reference": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "clones": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "computeci_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "cpu_alignment_profile": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: CpuAlignmentProfileSchemaMake(),
+ },
+ },
+ "cpupin": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "cpus": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "custom_fields": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "desc": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "devices": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "disks": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "driver": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "gid": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "hp_backed": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "hot_resize": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "interfaces": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: itemShadowComputeInterfaceSchemaMake(),
+ },
+ },
+ "live_migration_job_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "loader_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "lock_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "manager_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "manager_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "migrationjob": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "milestones": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "need_reboot": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "network_interface_naming": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "numa_affinity": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "numa_node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "os_users": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: listOsUsersSchemaMake(),
+ },
+ },
+ "os_version": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "pinned_to_node": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "preferred_cpu": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "qemu_guest": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: QemuGuestSchemaMake(),
+ },
+ },
+ "read_only": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reference_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "reserved_node_cpus": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "res_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "rg_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "snap_sets": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "disks": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "label": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "timestamp": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "stateless_sep_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "stateless_sep_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "tags": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "key": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "val": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "tech_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "user_managed": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "userdata": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vgpus": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "vnc_passwd": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "weight": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "zone_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ }
+}
+
+func itemShadowComputeInterfaceSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "target": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "pci_slot": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "bus_number": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "mac": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "mtu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "conn_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "conn_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "flip_group_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "net_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "net_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "ip_address": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "net_mask": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "def_gw": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vnfs": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "qos": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: qosSchemaMake(),
+ },
+ },
+ "libvirt_settings": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: libvirtSettingsSchemaMake(),
+ },
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "listen_ssh": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "enabled": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "node_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "sdn_interface_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "security_groups": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ "enable_secgroups": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "trunk_tags": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeInt},
+ },
+ }
}
func dataSourceComputeSnapshotUsageSchemaMake() map[string]*schema.Schema {
@@ -3430,16 +3798,24 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
ValidateFunc: validation.StringInSlice([]string{"Q35", "i440fx"}, false), // observe case while validating
Description: "Type of the emulated system.",
},
+ "clock": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "default",
+ ValidateFunc: validation.StringInSlice([]string{"default", "linux", "windows", "none"}, false),
+ Description: "Clock synchronization mode.",
+ },
"without_boot_disk": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "If True, the imageId, bootDisk, sepId, pool parameters are ignored and the compute is created without a boot disk in the stopped state.",
},
- "boot_disk_blk_discard": {
- Type: schema.TypeBool,
- Optional: true,
- Default: false,
+ "boot_disk_discard": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "ignore",
+ ValidateFunc: validation.StringInSlice([]string{"unmap", "ignore"}, false),
},
"create_blank": {
Type: schema.TypeBool,
@@ -3565,6 +3941,12 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "network enable flag",
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ Description: "Flag indicating whether default gateway is enabled for this interface. Applicable only to VINS network type",
+ },
"net_mask": {
Type: schema.TypeInt,
Optional: true,
@@ -3668,6 +4050,11 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Set affinity label for compute",
},
+ "cpu_alignment_profile": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "CPU alignment profile name",
+ },
"affinity_rules": {
Type: schema.TypeList,
Optional: true,
@@ -3773,10 +4160,11 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Required: true,
Description: "Storage policy id of disk. The rules of the specified storage policy will be used.",
},
- "blk_discard": {
- Type: schema.TypeBool,
- Optional: true,
- Default: false,
+ "discard": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "ignore",
+ ValidateFunc: validation.StringInSlice([]string{"unmap", "ignore"}, false),
},
"block_size": {
Type: schema.TypeString,
@@ -3838,6 +4226,12 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Optional: true,
Description: "Disk deletion status",
},
+ "read_only": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Computed: true,
+ Description: "Mount disk in read-only mode",
+ },
"disk_id": {
Type: schema.TypeInt,
Computed: true,
@@ -4337,176 +4731,17 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "bus_number": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "conn_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "def_gw": {
- Type: schema.TypeString,
- Computed: true,
- },
- "enabled": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "enable_secgroups": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "flip_group_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ip_address": {
- Type: schema.TypeString,
- Computed: true,
- },
- "listen_ssh": {
- Type: schema.TypeBool,
- Computed: true,
- },
- "mac": {
- Type: schema.TypeString,
- Computed: true,
- },
- "mtu": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- },
- "net_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "netmask": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "net_type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "node_id": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "pci_slot": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "qos": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "e_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "in_brust": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "in_rate": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "libvirt_settings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "guid": {
- Type: schema.TypeString,
- Computed: true,
- },
- "txmode": {
- Type: schema.TypeString,
- Computed: true,
- },
- "ioeventfd": {
- Type: schema.TypeString,
- Computed: true,
- },
- "event_idx": {
- Type: schema.TypeString,
- Computed: true,
- },
- "queues": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "rx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- "tx_queue_size": {
- Type: schema.TypeInt,
- Computed: true,
- },
- },
- },
- },
- "sdn_interface_id": {
- Type: schema.TypeString,
- Computed: true,
- },
- "security_groups": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- "target": {
- Type: schema.TypeString,
- Computed: true,
- },
- "type": {
- Type: schema.TypeString,
- Computed: true,
- },
- "trunk_tags": {
- Type: schema.TypeString,
- Computed: true,
- },
- "vnfs": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{
- Type: schema.TypeInt,
- },
- },
- },
+ Schema: interfaceSchemaMake(),
},
},
"image_name": {
Type: schema.TypeString,
Computed: true,
},
+ "user_data": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"lock_status": {
Type: schema.TypeString,
Computed: true,
@@ -4611,6 +4846,10 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
},
},
+ "resized_online": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"rg_name": {
Type: schema.TypeString,
Computed: true,
@@ -4640,6 +4879,10 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "memory_dump_image": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
},
},
},
@@ -4672,10 +4915,6 @@ func resourceComputeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
- "user_data": {
- Type: schema.TypeString,
- Computed: true,
- },
"user_managed": {
Type: schema.TypeBool,
Computed: true,
diff --git a/internal/service/cloudbroker/kvmvm/state_upgraders.go b/internal/service/cloudbroker/kvmvm/state_upgraders.go
index 30a6a09a..a7f00066 100644
--- a/internal/service/cloudbroker/kvmvm/state_upgraders.go
+++ b/internal/service/cloudbroker/kvmvm/state_upgraders.go
@@ -18,3 +18,33 @@ func resourceCompueteStateUpgradeV1(ctx context.Context, rawState map[string]int
return rawState, nil
}
+
+func resourceComputeStateUpgradeV2(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
+ log.Debug("resourceComputeStateUpgradeV2: upgrading state")
+
+ if v, ok := rawState["boot_disk_blk_discard"].(bool); ok {
+ if v {
+ rawState["boot_disk_discard"] = "unmap"
+ } else {
+ rawState["boot_disk_discard"] = "ignore"
+ }
+ }
+ delete(rawState, "boot_disk_blk_discard")
+
+ if disks, ok := rawState["disks"].([]interface{}); ok {
+ for _, d := range disks {
+ if disk, ok := d.(map[string]interface{}); ok {
+ if v, ok := disk["blk_discard"].(bool); ok {
+ if v {
+ disk["discard"] = "unmap"
+ } else {
+ disk["discard"] = "ignore"
+ }
+ }
+ delete(disk, "blk_discard")
+ }
+ }
+ }
+
+ return rawState, nil
+}
diff --git a/internal/service/cloudbroker/kvmvm/utility_compute.go b/internal/service/cloudbroker/kvmvm/utility_compute.go
index ccf2136d..4f95449b 100644
--- a/internal/service/cloudbroker/kvmvm/utility_compute.go
+++ b/internal/service/cloudbroker/kvmvm/utility_compute.go
@@ -265,7 +265,7 @@ func utilityComputeUpdateDisks(ctx context.Context, d *schema.ResourceData, m in
renamedDisks := make([]interface{}, 0)
changeStoragePolicyDisks := make([]interface{}, 0)
cacheUpdatedDisks := make([]interface{}, 0)
- blkDiscardUpdatedDisks := make([]interface{}, 0)
+ discardUpdatedDisks := make([]interface{}, 0)
blockSizeUpdatedDisks := make([]interface{}, 0)
iotuneUpdatedDisks := make([]interface{}, 0)
migratedDisks := make([]interface{}, 0)
@@ -325,8 +325,8 @@ func utilityComputeUpdateDisks(ctx context.Context, d *schema.ResourceData, m in
cacheUpdatedDisks = append(cacheUpdatedDisks, el)
}
- if isChangeBLKDiscardDisk(oldConv, el) {
- blkDiscardUpdatedDisks = append(blkDiscardUpdatedDisks, el)
+ if isChangeDiscardDisk(oldConv, el) {
+ discardUpdatedDisks = append(discardUpdatedDisks, el)
}
if isChangeBlockSizeDisk(oldConv, el) {
@@ -382,6 +382,9 @@ func utilityComputeUpdateDisks(ctx context.Context, d *schema.ResourceData, m in
if cacheVal, ok := diskConv["cache"].(string); ok {
req.Cache = cacheVal
}
+ if readOnly, ok := diskConv["read_only"].(bool); ok {
+ req.ReadOnly = readOnly
+ }
diskID, err := c.CloudBroker().Compute().DiskAdd(ctx, req)
if err != nil {
return err
@@ -515,8 +518,8 @@ func utilityComputeUpdateDisks(ctx context.Context, d *schema.ResourceData, m in
}
}
- if len(blkDiscardUpdatedDisks) > 0 {
- for _, disk := range blkDiscardUpdatedDisks {
+ if len(discardUpdatedDisks) > 0 {
+ for _, disk := range discardUpdatedDisks {
diskConv := disk.(map[string]interface{})
if isBootDisk(diskConv, chipset) {
continue
@@ -528,8 +531,8 @@ func utilityComputeUpdateDisks(ctx context.Context, d *schema.ResourceData, m in
}
req := disks.UpdateRequest{
- DiskID: diskID,
- BLKDiscard: diskConv["blk_discard"].(bool),
+ DiskID: diskID,
+ Discard: diskConv["discard"].(string),
}
_, err := c.CloudBroker().Disks().Update(ctx, req)
if err != nil {
@@ -672,10 +675,10 @@ func utilityComputeUpdateBootDiskCache(ctx context.Context, d *schema.ResourceDa
return err
}
-func utilityComputeUpdateBootDiskBLKDiscard(ctx context.Context, d *schema.ResourceData, m interface{}) error {
+func utilityComputeUpdateBootDiskDiscard(ctx context.Context, d *schema.ResourceData, m interface{}) error {
c := m.(*controller.ControllerCfg)
- newBLKDiscard := d.Get("boot_disk_blk_discard").(bool)
+ newDiscard := d.Get("boot_disk_discard").(string)
var bootDiskID uint64
if v, ok := d.GetOk("boot_disk_id"); ok {
@@ -685,12 +688,12 @@ func utilityComputeUpdateBootDiskBLKDiscard(ctx context.Context, d *schema.Resou
}
if bootDiskID == 0 {
- return fmt.Errorf("cannot update boot_disk_cache: boot disk ID is unknown for compute %s", d.Id())
+ return fmt.Errorf("cannot update boot_disk_discard: boot disk ID is unknown for compute %s", d.Id())
}
req := disks.UpdateRequest{
- DiskID: bootDiskID,
- BLKDiscard: newBLKDiscard,
+ DiskID: bootDiskID,
+ Discard: newDiscard,
}
_, err := c.CloudBroker().Disks().Update(ctx, req)
@@ -980,6 +983,10 @@ func utilityComputeNetworksConfigure(ctx context.Context, d *schema.ResourceData
req.SDNInterfaceID = netData["sdn_interface_id"].(string)
}
+ if req.NetType == "VINS" {
+ req.EnableDefaultGateway = netData["enable_default_gateway"].(bool)
+ }
+
_, err := c.CloudBroker().Compute().NetAttach(ctx, req)
if err != nil {
log.Errorf("utilityComputeNetworksConfigure: failed to attach net ID %d of type %s to Compute ID %s: %s",
@@ -1304,6 +1311,9 @@ func utilityComputeUpdate(ctx context.Context, d *schema.ResourceData, m interfa
if d.HasChange("chipset") {
req.Chipset = d.Get("chipset").(string)
}
+ if d.HasChange("clock") {
+ req.Clock = d.Get("clock").(string)
+ }
if d.HasChange("loader_type") {
req.LoaderType = d.Get("loader_type").(string)
@@ -1349,10 +1359,10 @@ func utilityComputeUpdate(ctx context.Context, d *schema.ResourceData, m interfa
}
}
- // Note bene: numa_affinity, cpu_pin and hp_backed are not allowed to be changed for compute in STARTED tech status.
+ // Note bene: numa_affinity, cpu_pin, hp_backed and clock are not allowed to be changed for compute in STARTED tech status.
// If STARTED, we need to stop it before update
var isStopRequired bool
- if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed", "chipset", "preferred_cpu", "hot_resize") && d.Get("started").(bool) {
+ if d.HasChanges("numa_affinity", "cpu_pin", "hp_backed", "chipset", "preferred_cpu", "hot_resize", "clock") && d.Get("started").(bool) {
isStopRequired = true
}
if isStopRequired {
@@ -2308,12 +2318,12 @@ func isChangeCacheDisk(els []interface{}, el interface{}) bool {
return false
}
-func isChangeBLKDiscardDisk(els []interface{}, el interface{}) bool {
+func isChangeDiscardDisk(els []interface{}, el interface{}) bool {
for _, elOld := range els {
elOldConv := elOld.(map[string]interface{})
elConv := el.(map[string]interface{})
if elOldConv["disk_id"].(int) == elConv["disk_id"].(int) &&
- elOldConv["blk_discard"].(bool) != elConv["blk_discard"].(bool) {
+ elOldConv["discard"].(string) != elConv["discard"].(string) {
return true
}
}
diff --git a/internal/service/cloudbroker/kvmvm/utility_compute_cpu_alignment_profile.go b/internal/service/cloudbroker/kvmvm/utility_compute_cpu_alignment_profile.go
new file mode 100644
index 00000000..01aa11b2
--- /dev/null
+++ b/internal/service/cloudbroker/kvmvm/utility_compute_cpu_alignment_profile.go
@@ -0,0 +1,71 @@
+/*
+Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+Kasim Baybikov,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package kvmvm
+
+import (
+ "context"
+ "strconv"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/compute"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
+)
+
+func utilityComputeUpdateCPUAlignmentProfile(ctx context.Context, d *schema.ResourceData, m interface{}) error {
+ c := m.(*controller.ControllerCfg)
+ computeId, _ := strconv.ParseUint(d.Id(), 10, 64)
+
+ profileName := d.Get("cpu_alignment_profile").(string)
+ if profileName == "" {
+ req := compute.DeleteCPUAlignmentProfileRequest{
+ ComputeIDs: []uint64{computeId},
+ }
+ _, err := c.CloudBroker().Compute().DeleteCPUAlignmentProfile(ctx, req)
+ return err
+ }
+
+ req := compute.SetCPUAlignmentProfileRequest{
+ ComputeIDs: []int64{int64(computeId)},
+ CPUAlignmentProfile: profileName,
+ }
+ _, err := c.CloudBroker().Compute().SetCPUAlignmentProfile(ctx, req)
+ return err
+}
+
+func utilityComputeGetCPUAlignmentProfile(ctx context.Context, d *schema.ResourceData, m interface{}) (*compute.CPUAlignmentProfile, error) {
+ c := m.(*controller.ControllerCfg)
+ req := compute.GetCPUAlignmentProfileRequest{
+ ComputeID: uint64(d.Get("compute_id").(int)),
+ }
+ return c.CloudBroker().Compute().GetCPUAlignmentProfile(ctx, req)
+}
diff --git a/internal/service/cloudbroker/kvmvm/utility_compute_migrate_storage_info.go b/internal/service/cloudbroker/kvmvm/utility_compute_migrate_storage_info.go
index 2023d826..2b48d29f 100644
--- a/internal/service/cloudbroker/kvmvm/utility_compute_migrate_storage_info.go
+++ b/internal/service/cloudbroker/kvmvm/utility_compute_migrate_storage_info.go
@@ -40,16 +40,11 @@ import (
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
)
-func utilityComputeMigrateStorageInfoCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (string, error) {
+func utilityComputeMigrateStorageInfoCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*compute.RecordMigrateStorageInfo, error) {
c := m.(*controller.ControllerCfg)
req := compute.MigrateStorageInfoRequest{
ComputeID: uint64(d.Get("compute_id").(int)),
}
- result, err := c.CloudBroker().Compute().MigrateStorageInfo(ctx, req)
- if err != nil {
- return "", err
- }
-
- return result, nil
+ return c.CloudBroker().Compute().MigrateStorageInfo(ctx, req)
}
diff --git a/internal/service/cloudbroker/node/data_source_node_network_info.go b/internal/service/cloudbroker/node/data_source_node_network_info.go
new file mode 100644
index 00000000..e3ac0a7a
--- /dev/null
+++ b/internal/service/cloudbroker/node/data_source_node_network_info.go
@@ -0,0 +1,355 @@
+/*
+Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+Sergey Kisil,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package node
+
+import (
+ "context"
+
+ "github.com/google/uuid"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/node"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
+)
+
+func dataSourceNodeNetworkInfoRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
+ c := m.(*controller.ControllerCfg)
+ req := node.GetNetworkInfoRequest{
+ NodeID: uint64(d.Get("node_id").(int)),
+ }
+
+ info, err := c.CloudBroker().Node().GetNetworkInfo(ctx, req)
+ if err != nil {
+ d.SetId("")
+ return diag.FromErr(err)
+ }
+
+ id := uuid.New()
+ d.SetId(id.String())
+ d.Set("system_networks_info", flattenSystemNetworksInfo(info.SystemNetworksInfo))
+ d.Set("ovs_networks_info", flattenOVSNetworksInfo(info.OVSNetworksInfo))
+ d.Set("libvirt_networks_info", flattenLibvirtNetworksInfo(info.LibvirtNetworksInfo))
+ d.Set("topology", flattenNetworkTopology(info.Topology))
+
+ return nil
+}
+
+func dataSourceNodeNetworkInfoSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "node_id": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "Node ID",
+ },
+ "system_networks_info": {
+ Type: schema.TypeList,
+ Computed: true,
+ Description: "System-level information about all network interfaces on the node",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface name",
+ },
+ "mtu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "MTU value",
+ },
+ "speed": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "Interface link speed",
+ },
+ "bridge_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Linux bridge ID",
+ },
+ "bport_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Bridge port ID",
+ },
+ "mac": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "MAC address",
+ },
+ },
+ },
+ },
+ "ovs_networks_info": {
+ Type: schema.TypeList,
+ Computed: true,
+ Description: "Raw OVS ports data",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "bridge_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Bridge name",
+ },
+ "bridge_tag": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Bridge tag",
+ },
+ "interface_uuid": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface UUID",
+ },
+ "interface_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface type",
+ },
+ "interface_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface name",
+ },
+ "interface_mtu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "Interface MTU value",
+ },
+ "interface_ip": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface IP address",
+ },
+ "interface_mac": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface MAC address",
+ },
+ "interface_peer": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface peer name",
+ },
+ },
+ },
+ },
+ "libvirt_networks_info": {
+ Type: schema.TypeList,
+ Computed: true,
+ Description: "VM network interface connections",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "vm_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "VM name",
+ },
+ "interface": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Host-side interface name used by the VM",
+ },
+ "interface_type": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface type",
+ },
+ "interface_source": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Name of the bridge the VM interface is attached to",
+ },
+ },
+ },
+ },
+ "topology": {
+ Type: schema.TypeList,
+ Computed: true,
+ Description: "Assembled network topology of the node",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "interfaces": {
+ Type: schema.TypeList,
+ Computed: true,
+ Description: "Network interfaces and their topology details",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface name",
+ },
+ "type": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Interface type",
+ },
+ "mtu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "Interface MTU value",
+ },
+ "speed": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "Interface link speed",
+ },
+ "vlans": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ Description: "VLANs associated with the interface",
+ },
+ "bridge_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Linux bridge ID",
+ },
+ "peer": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Peer interface name",
+ },
+ "uuid": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "OVS UUID",
+ },
+ "connected_interfaces": {
+ Type: schema.TypeList,
+ Computed: true, Elem: &schema.Schema{Type: schema.TypeString},
+ Description: "Names of interfaces attached to this bridge as ports",
+ },
+ "connections": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "vms": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {Type: schema.TypeString, Computed: true},
+ "vm_interface": {Type: schema.TypeString, Computed: true},
+ "vm_interface_type": {Type: schema.TypeString, Computed: true},
+ "connection_type": {Type: schema.TypeString, Computed: true},
+ "via_bridge": {Type: schema.TypeString, Computed: true},
+ },
+ },
+ },
+ "bridges": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {Type: schema.TypeString, Computed: true},
+ "type": {Type: schema.TypeString, Computed: true},
+ "via": {Type: schema.TypeString, Computed: true},
+ "bport_id": {Type: schema.TypeString, Computed: true},
+ "port_info": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {Type: schema.TypeString, Computed: true},
+ "type": {Type: schema.TypeString, Computed: true},
+ "mtu": {Type: schema.TypeInt, Computed: true},
+ "vlan": {Type: schema.TypeString, Computed: true},
+ "uuid": {Type: schema.TypeString, Computed: true},
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "bridge_info": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "type": {Type: schema.TypeString, Computed: true},
+ "ports": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {Type: schema.TypeString, Computed: true},
+ "type": {Type: schema.TypeString, Computed: true},
+ "mtu": {Type: schema.TypeInt, Computed: true},
+ "vlan": {Type: schema.TypeString, Computed: true},
+ "uuid": {Type: schema.TypeString, Computed: true},
+ "ip": {Type: schema.TypeString, Computed: true},
+ "mac": {Type: schema.TypeString, Computed: true},
+ },
+ },
+ },
+ },
+ },
+ },
+ "bridge_connections": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {Type: schema.TypeString, Computed: true},
+ "via": {Type: schema.TypeString, Computed: true},
+ "vlan": {Type: schema.TypeString, Computed: true},
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func DataSourceNodeNetworkInfo() *schema.Resource {
+ return &schema.Resource{
+ SchemaVersion: 1,
+ ReadContext: dataSourceNodeNetworkInfoRead,
+ Timeouts: &schema.ResourceTimeout{
+ Read: &constants.Timeout30s,
+ Default: &constants.Timeout60s,
+ },
+ Schema: dataSourceNodeNetworkInfoSchemaMake(),
+ }
+}
diff --git a/internal/service/cloudbroker/node/data_source_node_pci_devices.go b/internal/service/cloudbroker/node/data_source_node_pci_devices.go
new file mode 100644
index 00000000..f9034694
--- /dev/null
+++ b/internal/service/cloudbroker/node/data_source_node_pci_devices.go
@@ -0,0 +1,172 @@
+/*
+Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+Sergey Kisil,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package node
+
+import (
+ "context"
+
+ "github.com/google/uuid"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ sdknode "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/node"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
+)
+
+func dataSourceNodePCIDevicesRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
+ c := m.(*controller.ControllerCfg)
+ req := sdknode.GetPCIDevicesRequest{
+ NodeID: uint64(d.Get("node_id").(int)),
+ }
+ if v, ok := d.GetOk("search"); ok {
+ req.Search = v.(string)
+ }
+ if v, ok := d.GetOk("sort_by"); ok {
+ req.SortBy = v.(string)
+ }
+ if v, ok := d.GetOk("page"); ok {
+ req.Page = uint64(v.(int))
+ }
+ if v, ok := d.GetOk("size"); ok {
+ req.Size = uint64(v.(int))
+ }
+
+ list, err := c.CloudBroker().Node().GetPCIDevices(ctx, req)
+ if err != nil {
+ d.SetId("")
+ return diag.FromErr(err)
+ }
+
+ id := uuid.New()
+ d.SetId(id.String())
+ d.Set("items", flattenNodePCIDevices(list.Data))
+ d.Set("entry_count", list.EntryCount)
+
+ return nil
+}
+
+func dataSourceNodePCIDevicesSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "node_id": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "Node ID",
+ },
+ "search": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Search string",
+ },
+ "sort_by": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Sort by one of supported fields, format +|-(field)",
+ },
+ "page": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "Page number",
+ },
+ "size": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Description: "Page size",
+ },
+ "entry_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "Total number of PCI devices",
+ },
+ "items": {
+ Type: schema.TypeList,
+ Computed: true,
+ Description: "List of PCI devices",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "hw_path": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Hardware path",
+ },
+ "current_driver": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Current driver",
+ },
+ "numa_node": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "NUMA node",
+ },
+ "product_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Product ID",
+ },
+ "product_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Product name",
+ },
+ "vendor_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Vendor ID",
+ },
+ "vendor_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Vendor name",
+ },
+ "iommu_group": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "IOMMU group",
+ },
+ },
+ },
+ },
+ }
+}
+
+func DataSourceNodePCIDevices() *schema.Resource {
+ return &schema.Resource{
+ SchemaVersion: 1,
+ ReadContext: dataSourceNodePCIDevicesRead,
+ Timeouts: &schema.ResourceTimeout{
+ Read: &constants.Timeout30s,
+ Default: &constants.Timeout60s,
+ },
+ Schema: dataSourceNodePCIDevicesSchemaMake(),
+ }
+}
diff --git a/internal/service/cloudbroker/node/flattens.go b/internal/service/cloudbroker/node/flattens.go
index ff722cbd..8cea3966 100644
--- a/internal/service/cloudbroker/node/flattens.go
+++ b/internal/service/cloudbroker/node/flattens.go
@@ -62,6 +62,8 @@ func flattenNode(d *schema.ResourceData, item *node.RecordNode) {
d.Set("nic_info", flattenNicInfo(item.NicInfo))
d.Set("numa_topology", flattenNumaTopology(item.NumaTopology))
d.Set("reserved_cpus", flattenNodeItem(item.ReservedCPUs))
+ d.Set("reserved_cpu", item.ReservedCPU)
+ d.Set("reserved_ram", item.ReservedRAM)
d.Set("roles", item.Roles)
d.Set("sdn_hypervisor_name", item.SDNHypervisorName)
d.Set("sriov_enabled", item.SriovEnabled)
@@ -135,6 +137,7 @@ func flattenNodeList(nodes *node.ListNodes) []map[string]interface{} {
"ipaddr": item.IPAddr,
"isolated_cpus": flattenNodeItem(item.IsolatedCpus),
"lastcheck": item.LastCheck,
+ "machine_id": item.MachineID,
"machine_guid": item.MachineGUID,
"mainboard_sn": item.MainboardSN,
"memory": item.Memory,
@@ -154,6 +157,8 @@ func flattenNodeList(nodes *node.ListNodes) []map[string]interface{} {
"public_keys": item.PublicKeys,
"release": item.Release,
"reserved_cpus": flattenNodeItem(item.ReservedCPUs),
+ "reserved_cpu": int(item.ReservedCPU),
+ "reserved_ram": int(item.ReservedRAM),
"roles": item.Roles,
"sdn_hypervisor_name": item.SDNHypervisorName,
"seps": item.Seps,
@@ -173,6 +178,7 @@ func flattenNodeList(nodes *node.ListNodes) []map[string]interface{} {
"cpu_allocation_ratio": item.CPUAllocationRatio,
"mem_allocation_ratio": item.MemAllocationRatio,
"packages": flattenPackages(item.Packages),
+ "pci_devices": flattenNodePCIDevices(item.PCIDevices),
}
res = append(res, temp)
}
@@ -188,9 +194,18 @@ func flattenNumaTopology(info node.NumaTopologyInfo) []map[string]interface{} {
for _, item := range info.Nodes {
memoryTemp := []map[string]interface{}{
{
- "one_g": item.Memory.OneG,
- "two_m": item.Memory.TwoM,
- "total": item.Memory.Total,
+ "one_g": item.Memory.OneG,
+ "one_g_free": item.Memory.OneGFree,
+ "one_g_reserved": item.Memory.OneGReserved,
+ "one_g_available": item.Memory.OneGAvailable,
+ "one_g_used": item.Memory.OneGUsed,
+ "one_g_dpdk_reserved": item.Memory.OneGDPDKReserved,
+ "two_m": item.Memory.TwoM,
+ "two_m_free": item.Memory.TwoMFree,
+ "two_m_reserved": item.Memory.TwoMReserved,
+ "two_m_available": item.Memory.TwoMAvailable,
+ "two_m_used": item.Memory.TwoMUsed,
+ "total": item.Memory.Total,
},
}
temp := map[string]interface{}{
@@ -321,9 +336,9 @@ func flattenDPDKItem(dpdk node.DPDK) []map[string]interface{} {
}
res[0] = map[string]interface{}{
- "bridges": bridges,
- "hp_memory": dpdk.HPMemory,
- "pmd_cpu": dpdk.PMDCPU,
+ "bridges": bridges,
+ "ovs_dpdk_cores": dpdk.OVSDPDKCores,
+ "hp_memory": dpdk.HPMemory,
}
return res
@@ -339,3 +354,178 @@ func flattenRole(role node.Role) []map[string]interface{} {
res[0] = temp
return res
}
+
+func flattenSystemNetworksInfo(m map[string]node.SystemNetworkInfo) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(m))
+ for name, info := range m {
+ res = append(res, map[string]interface{}{
+ "name": name,
+ "mtu": info.MTU,
+ "speed": info.Speed,
+ "bridge_id": info.BridgeID,
+ "bport_id": info.BPortID,
+ "mac": info.MAC,
+ })
+ }
+ return res
+}
+
+func flattenOVSNetworksInfo(items []node.OVSNetworkInfo) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(items))
+ for _, item := range items {
+ res = append(res, map[string]interface{}{
+ "bridge_name": item.BridgeName,
+ "bridge_tag": item.BridgeTag,
+ "interface_uuid": item.InterfaceUUID,
+ "interface_type": item.InterfaceType,
+ "interface_name": item.InterfaceName,
+ "interface_mtu": item.InterfaceMTU,
+ "interface_ip": item.InterfaceIP,
+ "interface_mac": item.InterfaceMAC,
+ "interface_peer": item.InterfacePeer,
+ })
+ }
+ return res
+}
+
+func flattenLibvirtNetworksInfo(items []node.LibvirtNetworkInfo) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(items))
+ for _, item := range items {
+ res = append(res, map[string]interface{}{
+ "vm_name": item.VMName,
+ "interface": item.Interface,
+ "interface_type": item.InterfaceType,
+ "interface_source": item.InterfaceSource,
+ })
+ }
+ return res
+}
+
+func flattenNetworkTopology(t node.NetworkTopology) []map[string]interface{} {
+ return []map[string]interface{}{
+ {
+ "interfaces": flattenTopologyInterfaces(t.Interfaces),
+ },
+ }
+}
+
+func flattenTopologyInterfaces(m map[string]node.TopologyInterface) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(m))
+ for name, iface := range m {
+ res = append(res, map[string]interface{}{
+ "name": name,
+ "type": iface.Type,
+ "mtu": iface.MTU,
+ "speed": iface.Speed,
+ "vlans": iface.VLANs,
+ "bridge_id": iface.BridgeID,
+ "peer": iface.Peer,
+ "uuid": iface.UUID,
+ "connected_interfaces": iface.ConnectedInterfaces,
+ "connections": flattenTopologyConnections(iface.Connections),
+ "bridge_info": flattenTopologyBridgeInfo(iface.BridgeInfo),
+ "bridge_connections": flattenTopologyBridgeRefs(iface.BridgeConnections),
+ })
+ }
+ return res
+}
+
+func flattenTopologyConnections(c node.TopologyInterfaceConnections) []map[string]interface{} {
+ vms := make([]map[string]interface{}, 0, len(c.VMs))
+ for _, vm := range c.VMs {
+ vms = append(vms, map[string]interface{}{
+ "name": vm.Name,
+ "vm_interface": vm.VMInterface,
+ "vm_interface_type": vm.VMInterfaceType,
+ "connection_type": vm.ConnectionType,
+ "via_bridge": vm.ViaBridge,
+ })
+ }
+
+ bridges := make([]map[string]interface{}, 0, len(c.Bridges))
+ for _, b := range c.Bridges {
+ portInfo := flattenTopologyPortInfo(b.PortInfo)
+ bridges = append(bridges, map[string]interface{}{
+ "name": b.Name,
+ "type": b.Type,
+ "via": b.Via,
+ "bport_id": b.BPortID,
+ "port_info": portInfo,
+ })
+ }
+
+ return []map[string]interface{}{
+ {
+ "vms": vms,
+ "bridges": bridges,
+ },
+ }
+}
+
+func flattenTopologyPortInfo(p *node.TopologyPortInfo) []map[string]interface{} {
+ if p == nil {
+ return nil
+ }
+ return []map[string]interface{}{
+ {
+ "name": p.Name,
+ "type": p.Type,
+ "mtu": p.MTU,
+ "vlan": p.VLAN,
+ "uuid": p.UUID,
+ },
+ }
+}
+
+func flattenTopologyBridgeInfo(b *node.TopologyBridgeInfo) []map[string]interface{} {
+ if b == nil {
+ return nil
+ }
+ ports := make([]map[string]interface{}, 0, len(b.Ports))
+ for _, p := range b.Ports {
+ ports = append(ports, map[string]interface{}{
+ "name": p.Name,
+ "type": p.Type,
+ "mtu": p.MTU,
+ "vlan": p.VLAN,
+ "uuid": p.UUID,
+ "ip": p.IP,
+ "mac": p.MAC,
+ })
+ }
+ return []map[string]interface{}{
+ {
+ "type": b.Type,
+ "ports": ports,
+ },
+ }
+}
+
+func flattenTopologyBridgeRefs(refs []node.TopologyBridgeRef) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(refs))
+ for _, r := range refs {
+ res = append(res, map[string]interface{}{
+ "name": r.Name,
+ "via": r.Via,
+ "vlan": r.VLAN,
+ })
+ }
+ return res
+}
+
+func flattenNodePCIDevices(items []node.ItemPCIDevice) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(items))
+ for _, item := range items {
+ res = append(res, map[string]interface{}{
+ "hw_path": item.HWPath,
+ "current_driver": item.CurrentDriver,
+ "numa_node": item.NUMANode,
+ "product_id": item.ProductID,
+ "product_name": item.ProductName,
+ "vendor_id": item.VendorID,
+ "vendor_name": item.VendorName,
+ "iommu_group": item.IOMMUGroup,
+ })
+ }
+ return res
+}
diff --git a/internal/service/cloudbroker/node/schema.go b/internal/service/cloudbroker/node/schema.go
index 403b2254..75d7a29a 100644
--- a/internal/service/cloudbroker/node/schema.go
+++ b/internal/service/cloudbroker/node/schema.go
@@ -52,7 +52,7 @@ func dataSourceNodeSchemaMake() map[string]*schema.Schema {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"vcpu": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"ram": {
@@ -129,11 +129,11 @@ func dataSourceNodeSchemaMake() map[string]*schema.Schema {
},
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"mem_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"description": {
@@ -172,15 +172,15 @@ func dataSourceNodeSchemaMake() map[string]*schema.Schema {
},
},
},
- "hp_memory": {
- Type: schema.TypeMap,
+ "ovs_dpdk_cores": {
+ Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeInt,
},
},
- "pmd_cpu": {
- Type: schema.TypeList,
+ "hp_memory": {
+ Type: schema.TypeMap,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeInt,
@@ -331,10 +331,46 @@ func dataSourceNodeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "one_g_free": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_reserved": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_available": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_used": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_dpdk_reserved": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"two_m": {
Type: schema.TypeInt,
Computed: true,
},
+ "two_m_free": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "two_m_reserved": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "two_m_available": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "two_m_used": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"total": {
Type: schema.TypeInt,
Computed: true,
@@ -355,6 +391,14 @@ func dataSourceNodeSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
},
},
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"roles": {
Type: schema.TypeList,
Computed: true,
@@ -548,7 +592,7 @@ func dataSourceNodeListSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"cpu_info": {
@@ -629,15 +673,15 @@ func dataSourceNodeListSchemaMake() map[string]*schema.Schema {
},
},
},
- "hp_memory": {
- Type: schema.TypeMap,
+ "ovs_dpdk_cores": {
+ Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeInt,
},
},
- "pmd_cpu": {
- Type: schema.TypeList,
+ "hp_memory": {
+ Type: schema.TypeMap,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeInt,
@@ -680,6 +724,10 @@ func dataSourceNodeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "machine_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"machine_guid": {
Type: schema.TypeString,
Computed: true,
@@ -689,7 +737,7 @@ func dataSourceNodeListSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"mem_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"memory": {
@@ -848,10 +896,46 @@ func dataSourceNodeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "one_g_free": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_reserved": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_available": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_used": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "one_g_dpdk_reserved": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"two_m": {
Type: schema.TypeInt,
Computed: true,
},
+ "two_m_free": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "two_m_reserved": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "two_m_available": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "two_m_used": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"total": {
Type: schema.TypeInt,
Computed: true,
@@ -918,6 +1002,14 @@ func dataSourceNodeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
},
},
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
"roles": {
Type: schema.TypeList,
Computed: true,
@@ -978,6 +1070,46 @@ func dataSourceNodeListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "pci_devices": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "hw_path": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "current_driver": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "numa_node": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "product_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "product_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "iommu_group": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ },
+ },
+ },
},
},
},
diff --git a/internal/service/cloudbroker/rg/data_source_rg_audits.go b/internal/service/cloudbroker/rg/data_source_rg_audits.go
index 8cd285dc..4ee041cc 100644
--- a/internal/service/cloudbroker/rg/data_source_rg_audits.go
+++ b/internal/service/cloudbroker/rg/data_source_rg_audits.go
@@ -25,6 +25,8 @@ func DataSourceRgAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_cb_audit_list instead.",
+
ReadContext: dataSourceRgAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/rg/old_schemas.go b/internal/service/cloudbroker/rg/old_schemas.go
new file mode 100644
index 00000000..1810a9a2
--- /dev/null
+++ b/internal/service/cloudbroker/rg/old_schemas.go
@@ -0,0 +1,386 @@
+package rg
+
+import (
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
+)
+
+func resourceRGV1() *schema.Resource {
+ return &schema.Resource{Schema: resourceRgSchemaMakeV1()}
+}
+
+func resourceRgSchemaMakeV1() map[string]*schema.Schema {
+ res := map[string]*schema.Schema{
+ "account_id": {
+ Type: schema.TypeInt,
+ Required: true,
+ ValidateFunc: validation.IntAtLeast(1),
+ Description: "Unique ID of the account, which this resource group belongs to.",
+ },
+
+ "gid": {
+ Type: schema.TypeInt,
+ Required: true,
+ Description: "Unique ID of the grid, where this resource group is deployed.",
+ },
+
+ "rg_name": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "Name of this resource group. Names are case sensitive and unique within the context of a account.",
+ },
+
+ "resource_limits": {
+ Type: schema.TypeList,
+ Optional: true,
+ Computed: true,
+ MaxItems: 1,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "cu_c": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ Description: "MaxCPUCapacity",
+ },
+ "cu_d": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "cu_dm": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ Description: "MaxVDiskCapacity",
+ },
+ "cu_i": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ Description: "MaxNumPublicIP",
+ },
+ "cu_m": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ Description: "MaxMemoryCapacity",
+ },
+ "gpu_units": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "storage_policy": {
+ Type: schema.TypeSet,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "limit": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+
+ "owner": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "username - owner of this RG. Leave blank to set current user as owner",
+ },
+
+ "def_net_type": {
+ Type: schema.TypeString,
+ Optional: true,
+ ValidateFunc: validation.StringInSlice([]string{"PRIVATE", "PUBLIC", "NONE"}, false),
+ Description: "Type of the network, which this resource group will use as default for its computes - PRIVATE or PUBLIC or NONE.",
+ },
+
+ "ipcidr": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "Address of the netowrk inside the private network segment (aka ViNS) if def_net_type=PRIVATE",
+ },
+
+ "description": {
+ Type: schema.TypeString,
+ Optional: true,
+ Computed: true,
+ Description: "User-defined text description of this resource group.",
+ },
+
+ "ext_net_id": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Default: 0,
+ Description: "ID of the external network for default ViNS. Pass 0 if def_net_type=PUBLIC or no external connection required for the defult ViNS when def_net_type=PRIVATE",
+ },
+
+ "ext_ip": {
+ Type: schema.TypeString,
+ Optional: true,
+ Description: "IP address on the external netowrk to request when def_net_type=PRIVATE and ext_net_id is not 0",
+ },
+
+ "uniq_pools": {
+ Type: schema.TypeList,
+ Computed: true,
+ Optional: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ },
+
+ "access": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "user": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "User or group name to grant access",
+ },
+ "right": {
+ Type: schema.TypeString,
+ Required: true,
+ Description: "Access rights to set, one of 'R', 'RCX' or 'ARCXDU'",
+ },
+ },
+ },
+ },
+
+ "def_net": {
+ Type: schema.TypeSet,
+ Optional: true,
+ MaxItems: 1,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "net_type": {
+ Type: schema.TypeString,
+ Required: true,
+ ValidateFunc: validation.StringInSlice([]string{"PRIVATE", "PUBLIC"}, false),
+ Description: "Network type to set. Must be on of 'PRIVATE' or 'PUBLIC'.",
+ },
+ "net_id": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Default: 0,
+ Description: "Network segment ID. If netType is PUBLIC and netId is 0 then default external network segment will be selected. If netType is PRIVATE and netId=0, the first ViNS defined for this RG will be selected. Otherwise, netId identifies either existing external network segment or ViNS.",
+ },
+ },
+ },
+ },
+
+ "cpu_allocation_parameter": {
+ Type: schema.TypeString,
+ Optional: true,
+ Computed: true,
+ Description: "set cpu allocation parameter",
+ },
+
+ "cpu_allocation_ratio": {
+ Type: schema.TypeFloat,
+ Optional: true,
+ Computed: true,
+ Description: "set cpu allocation ratio",
+ },
+
+ "enable": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ Description: "enable/disable rg",
+ },
+ "restore": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: false,
+ Description: "restore deleted rg",
+ },
+
+ "force": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: false,
+ Description: "flag to force deleting resource group",
+ },
+ "permanently": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: false,
+ Description: "flag to permanently delete resource group",
+ },
+
+ "compute_features": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ ValidateFunc: validation.StringInSlice([]string{"hugepages", "numa", "cpupin", "vfnic", "dpdk", "changemac", "trunk"}, true),
+ },
+ },
+ "sdn_access_group_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ Computed: true,
+ Description: "ID of the SDN access group",
+ },
+ "storage_policy": {
+ Type: schema.TypeSet,
+ Optional: true,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "id": {
+ Type: schema.TypeInt,
+ Required: true,
+ },
+ "limit": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Default: -1,
+ },
+ },
+ },
+ },
+
+ "acl": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "email": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "explicit": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "right": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "type": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "user_group_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+
+ "account_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Name of the account, which this resource group belongs to.",
+ },
+ "created_by": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "created_time": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+
+ "def_net_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "ID of the default network for this resource group (if any).",
+ },
+
+ "deleted_by": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "deleted_time": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "guid": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "rg_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "lock_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "milestones": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "resource_types": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeString,
+ },
+ },
+ "secret": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "status": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Current status of this resource group.",
+ },
+ "updated_by": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "updated_time": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "vins": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ Description: "List of VINs deployed in this resource group.",
+ },
+ "vms": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ Description: "List of VM ids in this resource group.",
+ },
+
+ "storage_policy_ids": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
+ },
+ }
+
+ return res
+}
diff --git a/internal/service/cloudbroker/rg/resource_rg.go b/internal/service/cloudbroker/rg/resource_rg.go
index 3b7a7853..17a55d44 100644
--- a/internal/service/cloudbroker/rg/resource_rg.go
+++ b/internal/service/cloudbroker/rg/resource_rg.go
@@ -105,6 +105,10 @@ func resourceResgroupCreate(ctx context.Context, d *schema.ResourceData, m inter
req.Owner = owner.(string)
}
+ if enableDefaultGateway, ok := d.GetOkExists("enable_default_gateway"); ok {
+ req.EnableDefaultGateway = enableDefaultGateway.(bool)
+ }
+
if _, ok := d.GetOk("def_net"); !ok {
if defNetType, ok := d.GetOk("def_net_type"); ok {
if defNetType.(string) == "PRIVATE" {
@@ -667,14 +671,14 @@ func resourceRGSetCPUAllocationParameter(ctx context.Context, d *schema.Resource
}
func resourceRGSetCPUAllocationRatio(ctx context.Context, d *schema.ResourceData, m interface{}) error {
- cpuAllocationRatio := d.Get("cpu_allocation_ratio").(float64)
- log.Debugf("resourceRGSetCPUAllocationRatio: cpuAllocationRatio %s for rg id %d", cpuAllocationRatio, uint64(d.Get("rg_id").(int)))
+ cpuAllocationRatio := uint64(d.Get("cpu_allocation_ratio").(int))
+ log.Debugf("resourceRGSetCPUAllocationRatio: cpuAllocationRatio %d for rg id %d", cpuAllocationRatio, uint64(d.Get("rg_id").(int)))
c := m.(*controller.ControllerCfg)
req := rg.SetCPUAllocationRatioRequest{
RGID: uint64(d.Get("rg_id").(int)),
- Ratio: cpuAllocationRatio,
+ Ratio: uint64(d.Get("cpu_allocation_ratio").(int)),
}
_, err := c.CloudBroker().RG().SetCPUAllocationRatio(ctx, req)
@@ -777,7 +781,7 @@ func resourceRGChangeComputeFeatures(ctx context.Context, d *schema.ResourceData
func ResourceResgroup() *schema.Resource {
return &schema.Resource{
- SchemaVersion: 1,
+ SchemaVersion: 2,
CreateContext: resourceResgroupCreate,
ReadContext: resourceResgroupRead,
@@ -812,5 +816,12 @@ func ResourceResgroup() *schema.Resource {
},
Schema: resourceRgSchemaMake(),
+ StateUpgraders: []schema.StateUpgrader{
+ {
+ Type: resourceRGV1().CoreConfigSchema().ImpliedType(),
+ Upgrade: resourceRGStateUpgradeV1,
+ Version: 1,
+ },
+ },
}
}
diff --git a/internal/service/cloudbroker/rg/schema.go b/internal/service/cloudbroker/rg/schema.go
index a9a1b27c..d90ea956 100644
--- a/internal/service/cloudbroker/rg/schema.go
+++ b/internal/service/cloudbroker/rg/schema.go
@@ -68,7 +68,7 @@ func dataSourceRgSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"created_by": {
@@ -1518,6 +1518,10 @@ func dataSourceRgListDeletedSchemaMake() map[string]*schema.Schema {
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
+ "email": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"explicit": {
Type: schema.TypeBool,
Computed: true,
@@ -1557,7 +1561,7 @@ func dataSourceRgListDeletedSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"created_by": {
@@ -1812,6 +1816,10 @@ func dataSourceRgListSchemaMake() map[string]*schema.Schema {
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
+ "email": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"explicit": {
Type: schema.TypeBool,
Computed: true,
@@ -1851,7 +1859,7 @@ func dataSourceRgListSchemaMake() map[string]*schema.Schema {
Computed: true,
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Computed: true,
},
"created_by": {
@@ -2238,6 +2246,10 @@ func resourceRgSchemaMake() map[string]*schema.Schema {
Description: "Name of this resource group. Names are case sensitive and unique within the context of a account.",
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Optional: true,
+ },
"resource_limits": {
Type: schema.TypeList,
Optional: true,
@@ -2395,7 +2407,7 @@ func resourceRgSchemaMake() map[string]*schema.Schema {
},
"cpu_allocation_ratio": {
- Type: schema.TypeFloat,
+ Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "set cpu allocation ratio",
diff --git a/internal/service/cloudbroker/rg/state_upgraders.go b/internal/service/cloudbroker/rg/state_upgraders.go
new file mode 100644
index 00000000..20d6419d
--- /dev/null
+++ b/internal/service/cloudbroker/rg/state_upgraders.go
@@ -0,0 +1,15 @@
+package rg
+
+import (
+ "context"
+
+ log "github.com/sirupsen/logrus"
+)
+
+func resourceRGStateUpgradeV1(ctx context.Context, rawState map[string]interface{}, meta any) (map[string]interface{}, error) {
+ log.Debug("resourceRGStateUpgradeV1: upgrading state")
+ if v, ok := rawState["cpu_allocation_ratio"]; ok && v != nil {
+ rawState["cpu_allocation_ratio"] = int(v.(float64))
+ }
+ return rawState, nil
+}
diff --git a/internal/service/cloudbroker/sep/data_source_sep_consumption.go b/internal/service/cloudbroker/sep/data_source_sep_consumption.go
index a6978930..56c4b74f 100644
--- a/internal/service/cloudbroker/sep/data_source_sep_consumption.go
+++ b/internal/service/cloudbroker/sep/data_source_sep_consumption.go
@@ -50,7 +50,7 @@ func dataSourceSepConsumptionRead(ctx context.Context, d *schema.ResourceData, m
id := uuid.New()
d.SetId(id.String())
- flattenSepConsumption(d, sepCons)
+ flattenSepConsumptionList(d, sepCons)
return nil
}
diff --git a/internal/service/cloudbroker/sep/flattens.go b/internal/service/cloudbroker/sep/flattens.go
index 9eb44785..01f11b72 100644
--- a/internal/service/cloudbroker/sep/flattens.go
+++ b/internal/service/cloudbroker/sep/flattens.go
@@ -110,15 +110,28 @@ func flattenSepPoolUris(rp *sep.RecordPool) []map[string]interface{} {
return res
}
-func flattenSepConsumption(d *schema.ResourceData, sepCons *sep.RecordConsumption) {
- d.Set("type", sepCons.Type)
- d.Set("total", flattenSepConsumptionTotal(sepCons.Total))
- d.Set("by_pool", flattenSepConsumptionPools(sepCons))
+func flattenSepConsumptionList(d *schema.ResourceData, list *sep.ListConsumption) {
+ d.Set("entry_count", list.EntryCount)
+ d.Set("items", flattenSepConsumptionItems(list.Data))
+}
+
+func flattenSepConsumptionItems(records []sep.RecordConsumption) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(records))
+ for _, r := range records {
+ res = append(res, map[string]interface{}{
+ "sep_id": r.ID,
+ "name": r.Name,
+ "type": r.Type,
+ "consumed_by": r.ConsumedBy,
+ "total": flattenSepConsumptionTotal(r.Total),
+ "by_pool": flattenSepConsumptionPools(r.ByPool),
+ })
+ }
+ return res
}
func flattenSepConsumptionTotal(sc sep.Total) []map[string]interface{} {
- sh := make([]map[string]interface{}, 0)
- temp := map[string]interface{}{
+ return []map[string]interface{}{{
"capacity_limit": sc.CapacityLimit,
"disk_count": sc.DiskCount,
"disk_usage": sc.DiskUsage,
@@ -126,15 +139,13 @@ func flattenSepConsumptionTotal(sc sep.Total) []map[string]interface{} {
"snapshot_usage": sc.SnapshotUsage,
"usage": sc.Usage,
"usage_limit": sc.UsageLimit,
- }
- sh = append(sh, temp)
- return sh
+ }}
}
-func flattenSepConsumptionPools(bp *sep.RecordConsumption) []map[string]interface{} {
- sh := make([]map[string]interface{}, 0)
- for key, value := range bp.ByPool {
- temp := map[string]interface{}{
+func flattenSepConsumptionPools(byPool map[string]sep.ByPool) []map[string]interface{} {
+ sh := make([]map[string]interface{}, 0, len(byPool))
+ for key, value := range byPool {
+ sh = append(sh, map[string]interface{}{
"name": key,
"disk_count": value.DiskCount,
"disk_usage": value.DiskUsage,
@@ -142,8 +153,7 @@ func flattenSepConsumptionPools(bp *sep.RecordConsumption) []map[string]interfac
"snapshot_usage": value.SnapshotUsage,
"usage": value.Usage,
"usage_limit": value.UsageLimit,
- }
- sh = append(sh, temp)
+ })
}
return sh
}
diff --git a/internal/service/cloudbroker/sep/schema.go b/internal/service/cloudbroker/sep/schema.go
index 7bc4d83d..57b4ceda 100644
--- a/internal/service/cloudbroker/sep/schema.go
+++ b/internal/service/cloudbroker/sep/schema.go
@@ -129,102 +129,134 @@ func dataSourceSepConsumptionSchemaMake() map[string]*schema.Schema {
return map[string]*schema.Schema{
"sep_id": {
Type: schema.TypeInt,
- Required: true,
+ Optional: true,
Description: "sep id",
},
- "by_pool": {
+ "entry_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "number of entries",
+ },
+ "items": {
Type: schema.TypeList,
Computed: true,
- Description: "consumption divided by pool",
+ Description: "list of sep consumption records",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
+ "sep_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "sep id",
+ },
"name": {
Type: schema.TypeString,
Computed: true,
- Description: "pool name",
+ Description: "sep name",
},
- "disk_count": {
- Type: schema.TypeInt,
+ "type": {
+ Type: schema.TypeString,
Computed: true,
- Description: "number of disks",
+ Description: "sep type",
},
- "disk_usage": {
- Type: schema.TypeInt,
+ "consumed_by": {
+ Type: schema.TypeList,
Computed: true,
- Description: "disk usage",
+ Description: "list of consumer node IDs",
+ Elem: &schema.Schema{
+ Type: schema.TypeInt,
+ },
},
- "snapshot_count": {
- Type: schema.TypeInt,
+ "by_pool": {
+ Type: schema.TypeList,
Computed: true,
- Description: "number of snapshots",
+ Description: "consumption divided by pool",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "pool name",
+ },
+ "disk_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "number of disks",
+ },
+ "disk_usage": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "disk usage",
+ },
+ "snapshot_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "number of snapshots",
+ },
+ "snapshot_usage": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "snapshot usage",
+ },
+ "usage": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "usage",
+ },
+ "usage_limit": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "usage limit",
+ },
+ },
+ },
},
- "snapshot_usage": {
- Type: schema.TypeInt,
+ "total": {
+ Type: schema.TypeList,
Computed: true,
- Description: "snapshot usage",
- },
- "usage": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "usage",
- },
- "usage_limit": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "usage limit",
+ Description: "total consumption",
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "capacity_limit": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "capacity limit",
+ },
+ "disk_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "number of disks",
+ },
+ "disk_usage": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "disk usage",
+ },
+ "snapshot_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "number of snapshots",
+ },
+ "snapshot_usage": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "snapshot usage",
+ },
+ "usage": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "usage",
+ },
+ "usage_limit": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "usage limit",
+ },
+ },
+ },
},
},
},
},
- "total": {
- Type: schema.TypeList,
- Computed: true,
- Description: "total consumption",
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "capacity_limit": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "capacity limit",
- },
- "disk_count": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "number of disks",
- },
- "disk_usage": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "disk usage",
- },
- "snapshot_count": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "number of snapshots",
- },
- "snapshot_usage": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "snapshot usage",
- },
- "usage": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "usage",
- },
- "usage_limit": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "usage limit",
- },
- },
- },
- },
- "type": {
- Type: schema.TypeString,
- Computed: true,
- Description: "sep type",
- },
}
}
@@ -522,6 +554,7 @@ func resourceSepSchemaMake() map[string]*schema.Schema {
Optional: true,
Computed: true,
Description: "grant or revoke access to pool",
+ Deprecated: "\"access_to_pool\" is deprecated and will be removed in version 4.14.0",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"pool_name": {
@@ -546,6 +579,7 @@ func resourceSepSchemaMake() map[string]*schema.Schema {
Type: schema.TypeSet,
Optional: true,
Description: "lift of account ids to have access to sep",
+ Deprecated: "\"account_ids\" is deprecated and will be removed in version 4.14.0",
Elem: &schema.Schema{
Type: schema.TypeInt,
},
diff --git a/internal/service/cloudbroker/sep/utility_sep_consumption.go b/internal/service/cloudbroker/sep/utility_sep_consumption.go
index ef8bf5dc..27d25bff 100644
--- a/internal/service/cloudbroker/sep/utility_sep_consumption.go
+++ b/internal/service/cloudbroker/sep/utility_sep_consumption.go
@@ -39,16 +39,16 @@ import (
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
)
-func utilitySepConsumptionCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*sep.RecordConsumption, error) {
+func utilitySepConsumptionCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*sep.ListConsumption, error) {
c := m.(*controller.ControllerCfg)
req := sep.ConsumptionRequest{
SEPID: uint64(d.Get("sep_id").(int)),
}
- sepCons, err := c.CloudBroker().SEP().Consumption(ctx, req)
+ result, err := c.CloudBroker().SEP().Consumption(ctx, req)
if err != nil {
return nil, err
}
- return sepCons, nil
+ return result, nil
}
diff --git a/internal/service/cloudbroker/user/data_source_user_get_audit.go b/internal/service/cloudbroker/user/data_source_user_get_audit.go
index 96b2ebbc..049710f8 100644
--- a/internal/service/cloudbroker/user/data_source_user_get_audit.go
+++ b/internal/service/cloudbroker/user/data_source_user_get_audit.go
@@ -59,6 +59,8 @@ func DataSourceUserGetAudit() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0.",
+
ReadContext: dataSourceUserGetAuditRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/user/flattens.go b/internal/service/cloudbroker/user/flattens.go
index 1cf52733..b0a9b30e 100644
--- a/internal/service/cloudbroker/user/flattens.go
+++ b/internal/service/cloudbroker/user/flattens.go
@@ -63,7 +63,6 @@ func flattenUserDataSource(d *schema.ResourceData, details *user.ItemUser) {
d.Set("guid", details.GUID)
d.Set("last_check", details.LastCheck)
d.Set("mobile", flattenItemUser(details.Mobile))
- d.Set("password", details.Password)
d.Set("protected", details.Protected)
d.Set("roles", flattenItemUser(details.Roles))
d.Set("service_account", details.ServiceAccount)
@@ -157,7 +156,6 @@ func flattenUserList(users *user.ListUsers) []map[string]interface{} {
"user_id": item.ID,
"last_check": item.LastCheck,
"mobile": flattenItemUser(item.Mobile),
- "password": item.Password,
"protected": item.Protected,
"roles": flattenItemUser(item.Roles),
"service_account": item.ServiceAccount,
diff --git a/internal/service/cloudbroker/user/resource_user.go b/internal/service/cloudbroker/user/resource_user.go
index 23169725..24781284 100644
--- a/internal/service/cloudbroker/user/resource_user.go
+++ b/internal/service/cloudbroker/user/resource_user.go
@@ -13,7 +13,7 @@ import (
func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
- log.Debugf("resourceUserCreate: called with username %s, emailaddress %v", d.Get("username").(string), d.Get("emailaddress").([]interface{}))
+ log.Debugf("resourceUserCreate: called with username %s, emailaddress %v", d.Get("username").(string), d.Get("emailaddress").(string))
c := m.(*controller.ControllerCfg)
@@ -26,10 +26,7 @@ func resourceUserCreate(ctx context.Context, d *schema.ResourceData, m interface
EmailAddress: email,
}
- if passwd, ok := d.GetOk("password"); ok {
-
- createReq.Password = passwd.(string)
- }
+ createReq.Password = d.Get("password").(string)
if provider, ok := d.GetOk("provider_name"); ok {
createReq.Provider = provider.(string)
diff --git a/internal/service/cloudbroker/user/schema.go b/internal/service/cloudbroker/user/schema.go
index 157d6586..4b9e5ae4 100644
--- a/internal/service/cloudbroker/user/schema.go
+++ b/internal/service/cloudbroker/user/schema.go
@@ -111,11 +111,6 @@ func dataSourceUserSchemaMake() map[string]*schema.Schema {
},
Description: "mobile",
},
- "password": {
- Type: schema.TypeString,
- Computed: true,
- Description: "password",
- },
"protected": {
Type: schema.TypeBool,
Computed: true,
@@ -370,11 +365,6 @@ func dataSourceUserListSchemaMake() map[string]*schema.Schema {
},
Description: "mobile",
},
- "password": {
- Type: schema.TypeString,
- Computed: true,
- Description: "password",
- },
"protected": {
Type: schema.TypeBool,
Computed: true,
@@ -427,8 +417,8 @@ func resourceUserSchemaMake() map[string]*schema.Schema {
},
"password": {
Type: schema.TypeString,
- Default: "strongpassword",
- Optional: true,
+ Required: true,
+ Sensitive: true,
Description: "password of user",
},
"provider_name": {
diff --git a/internal/service/cloudbroker/vins/data_source_vins_audits.go b/internal/service/cloudbroker/vins/data_source_vins_audits.go
index 0ac2796c..16bf1a79 100644
--- a/internal/service/cloudbroker/vins/data_source_vins_audits.go
+++ b/internal/service/cloudbroker/vins/data_source_vins_audits.go
@@ -59,6 +59,8 @@ func DataSourceVinsAudits() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
+ DeprecationMessage: "This data source is deprecated and will be removed in version 4.14.0; use decort_cb_audit_list instead.",
+
ReadContext: dataSourceVinsAuditsRead,
Timeouts: &schema.ResourceTimeout{
diff --git a/internal/service/cloudbroker/vins/flattens.go b/internal/service/cloudbroker/vins/flattens.go
index c9f0da4a..81a11b88 100644
--- a/internal/service/cloudbroker/vins/flattens.go
+++ b/internal/service/cloudbroker/vins/flattens.go
@@ -46,6 +46,7 @@ func flattenVins(d *schema.ResourceData, vinsRecord *vins.RecordVINS) {
d.Set("created_by", vinsRecord.CreatedBy)
d.Set("created_time", vinsRecord.CreatedTime)
d.Set("default_gw", vinsRecord.DefaultGW)
+ d.Set("enable_default_gateway", vinsRecord.EnableDefaultGateway)
d.Set("default_qos", flattenVinsQOS(vinsRecord.DefaultQOS))
d.Set("deleted_by", vinsRecord.DeletedBy)
d.Set("deleted_time", vinsRecord.DeletedTime)
@@ -86,6 +87,7 @@ func flattenVinsData(d *schema.ResourceData, vinsRecord *vins.RecordVINS) {
d.Set("created_by", vinsRecord.CreatedBy)
d.Set("created_time", vinsRecord.CreatedTime)
d.Set("default_gw", vinsRecord.DefaultGW)
+ d.Set("enable_default_gateway", vinsRecord.EnableDefaultGateway)
d.Set("default_qos", flattenVinsQOS(vinsRecord.DefaultQOS))
d.Set("deleted_by", vinsRecord.DeletedBy)
d.Set("deleted_time", vinsRecord.DeletedTime)
@@ -464,42 +466,43 @@ func flattenVinsList(vl *vins.ListVINS) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(vl.Data))
for _, v := range vl.Data {
temp := map[string]interface{}{
- "account_id": v.AccountID,
- "account_name": v.AccountName,
- "created_by": v.CreatedBy,
- "created_time": v.CreatedTime,
- "default_gw": v.DefaultGW,
- "default_qos": flattenVinsQOS(v.DefaultQOS),
- "deleted_by": v.DeletedBy,
- "deleted_time": v.DeletedTime,
- "description": v.Description,
- "enable_secgroups": v.EnableSecGroups,
- "external_ip": v.ExternalIP,
- "extnet_id": v.ExtnetId,
- "free_ips": v.FreeIPs,
- "gid": v.GID,
- "guid": v.GUID,
- "vins_id": v.ID,
- "name": v.Name,
- "lock_status": v.LockStatus,
- "manager_id": v.ManagerID,
- "manager_type": v.ManagerType,
- "milestones": v.Milestones,
- "netmask": v.NetMask,
- "network": v.Network,
- "pre_reservations_num": v.PreReservationsNum,
- "pri_vnf_dev_id": v.PriVNFDevID,
- "redundant": v.Redundant,
- "rg_id": v.RGID,
- "rg_name": v.RGName,
- "sec_vnf_dev_id": v.SecVNFDevID,
- "status": v.Status,
- "updated_by": v.UpdatedBy,
- "updated_time": v.UpdatedTime,
- "user_managed": v.UserManaged,
- "vnfs": flattenVinsVNFs(v.VNFs),
- "vxlan_id": v.VXLANID,
- "zone_id": v.ZoneID,
+ "account_id": v.AccountID,
+ "account_name": v.AccountName,
+ "created_by": v.CreatedBy,
+ "created_time": v.CreatedTime,
+ "default_gw": v.DefaultGW,
+ "enable_default_gateway": v.EnableDefaultGateway,
+ "default_qos": flattenVinsQOS(v.DefaultQOS),
+ "deleted_by": v.DeletedBy,
+ "deleted_time": v.DeletedTime,
+ "description": v.Description,
+ "enable_secgroups": v.EnableSecGroups,
+ "external_ip": v.ExternalIP,
+ "extnet_id": v.ExtnetId,
+ "free_ips": v.FreeIPs,
+ "gid": v.GID,
+ "guid": v.GUID,
+ "vins_id": v.ID,
+ "name": v.Name,
+ "lock_status": v.LockStatus,
+ "manager_id": v.ManagerID,
+ "manager_type": v.ManagerType,
+ "milestones": v.Milestones,
+ "netmask": v.NetMask,
+ "network": v.Network,
+ "pre_reservations_num": v.PreReservationsNum,
+ "pri_vnf_dev_id": v.PriVNFDevID,
+ "redundant": v.Redundant,
+ "rg_id": v.RGID,
+ "rg_name": v.RGName,
+ "sec_vnf_dev_id": v.SecVNFDevID,
+ "status": v.Status,
+ "updated_by": v.UpdatedBy,
+ "updated_time": v.UpdatedTime,
+ "user_managed": v.UserManaged,
+ "vnfs": flattenVinsVNFs(v.VNFs),
+ "vxlan_id": v.VXLANID,
+ "zone_id": v.ZoneID,
}
res = append(res, temp)
}
@@ -510,39 +513,40 @@ func flattenVinsListDeleted(vl *vins.ListVINS) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(vl.Data))
for _, v := range vl.Data {
temp := map[string]interface{}{
- "account_id": v.AccountID,
- "account_name": v.AccountName,
- "created_by": v.CreatedBy,
- "created_time": v.CreatedTime,
- "default_gw": v.DefaultGW,
- "default_qos": flattenVinsQOS(v.DefaultQOS),
- "deleted_by": v.DeletedBy,
- "deleted_time": v.DeletedTime,
- "description": v.Description,
- "external_ip": v.ExternalIP,
- "gid": v.GID,
- "guid": v.GUID,
- "vins_id": v.ID,
- "name": v.Name,
- "lock_status": v.LockStatus,
- "manager_id": v.ManagerID,
- "manager_type": v.ManagerType,
- "milestones": v.Milestones,
- "netmask": v.NetMask,
- "network": v.Network,
- "pre_reservations_num": v.PreReservationsNum,
- "pri_vnf_dev_id": v.PriVNFDevID,
- "redundant": v.Redundant,
- "rg_id": v.RGID,
- "rg_name": v.RGName,
- "sec_vnf_dev_id": v.SecVNFDevID,
- "status": v.Status,
- "updated_by": v.UpdatedBy,
- "updated_time": v.UpdatedTime,
- "user_managed": v.UserManaged,
- "vnfs": flattenVinsVNFs(v.VNFs),
- "vxlan_id": v.VXLANID,
- "zone_id": v.ZoneID,
+ "account_id": v.AccountID,
+ "account_name": v.AccountName,
+ "created_by": v.CreatedBy,
+ "created_time": v.CreatedTime,
+ "default_gw": v.DefaultGW,
+ "enable_default_gateway": v.EnableDefaultGateway,
+ "default_qos": flattenVinsQOS(v.DefaultQOS),
+ "deleted_by": v.DeletedBy,
+ "deleted_time": v.DeletedTime,
+ "description": v.Description,
+ "external_ip": v.ExternalIP,
+ "gid": v.GID,
+ "guid": v.GUID,
+ "vins_id": v.ID,
+ "name": v.Name,
+ "lock_status": v.LockStatus,
+ "manager_id": v.ManagerID,
+ "manager_type": v.ManagerType,
+ "milestones": v.Milestones,
+ "netmask": v.NetMask,
+ "network": v.Network,
+ "pre_reservations_num": v.PreReservationsNum,
+ "pri_vnf_dev_id": v.PriVNFDevID,
+ "redundant": v.Redundant,
+ "rg_id": v.RGID,
+ "rg_name": v.RGName,
+ "sec_vnf_dev_id": v.SecVNFDevID,
+ "status": v.Status,
+ "updated_by": v.UpdatedBy,
+ "updated_time": v.UpdatedTime,
+ "user_managed": v.UserManaged,
+ "vnfs": flattenVinsVNFs(v.VNFs),
+ "vxlan_id": v.VXLANID,
+ "zone_id": v.ZoneID,
}
res = append(res, temp)
}
diff --git a/internal/service/cloudbroker/vins/resource_utility.go b/internal/service/cloudbroker/vins/resource_utility.go
index a1d69e49..b7206b66 100644
--- a/internal/service/cloudbroker/vins/resource_utility.go
+++ b/internal/service/cloudbroker/vins/resource_utility.go
@@ -89,6 +89,7 @@ func createVinsInAcc(ctx context.Context, d *schema.ResourceData, m interface{},
}
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
+ req.EnableDefaultGateway = d.Get("enable_default_gateway").(bool)
return req, nil
}
@@ -146,6 +147,7 @@ func createVinsInRG(ctx context.Context, d *schema.ResourceData, m interface{},
}
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
+ req.EnableDefaultGateway = d.Get("enable_default_gateway").(bool)
return req, nil
}
diff --git a/internal/service/cloudbroker/vins/resource_vins.go b/internal/service/cloudbroker/vins/resource_vins.go
index 72df5519..35984950 100644
--- a/internal/service/cloudbroker/vins/resource_vins.go
+++ b/internal/service/cloudbroker/vins/resource_vins.go
@@ -115,6 +115,12 @@ func resourceVinsCreate(ctx context.Context, d *schema.ResourceData, m interface
}
}
+ if start, ok := d.GetOkExists("vnfdev_start"); ok && !start.(bool) {
+ if err := resourceVinsVnfDevStop(ctx, m, vinsID); err != nil {
+ warnings.Add(err)
+ }
+ }
+
return append(warnings.Get(), resourceVinsRead(ctx, d, m)...)
}
@@ -257,7 +263,7 @@ func resourceVinsUpdate(ctx context.Context, d *schema.ResourceData, m interface
}
}
- if d.HasChanges("name", "desc", "enable_secgroups") {
+ if d.HasChanges("name", "desc", "enable_secgroups", "enable_default_gateway") {
vinsID := uint64(d.Get("vins_id").(int))
if err := utilityUpdateVINS(ctx, d, m, vinsID); err != nil {
return diag.FromErr(err)
@@ -366,7 +372,7 @@ func resourceVinsDelete(ctx context.Context, d *schema.ResourceData, m interface
return nil
}
-func resourceVinsEnable(ctx context.Context, d *schema.ResourceData, m interface{}, vinsId uint64) error {
+func resourceVinsEnable(ctx context.Context, _ *schema.ResourceData, m interface{}, vinsId uint64) error {
c := m.(*controller.ControllerCfg)
req := vins.EnableRequest{
@@ -377,7 +383,7 @@ func resourceVinsEnable(ctx context.Context, d *schema.ResourceData, m interface
return err
}
-func resourceVinsDisable(ctx context.Context, d *schema.ResourceData, m interface{}, vinsId uint64) error {
+func resourceVinsDisable(ctx context.Context, _ *schema.ResourceData, m interface{}, vinsId uint64) error {
c := m.(*controller.ControllerCfg)
req := vins.DisableRequest{
@@ -388,7 +394,7 @@ func resourceVinsDisable(ctx context.Context, d *schema.ResourceData, m interfac
return err
}
-func resourceVinsRestore(ctx context.Context, d *schema.ResourceData, m interface{}, vinsId uint64) error {
+func resourceVinsRestore(ctx context.Context, _ *schema.ResourceData, m interface{}, vinsId uint64) error {
c := m.(*controller.ControllerCfg)
req := vins.RestoreRequest{
@@ -765,20 +771,27 @@ func resourceVinsChangeVnfReset(ctx context.Context, d *schema.ResourceData, m i
}
func resourceVinsChangeVnfStartStop(ctx context.Context, d *schema.ResourceData, m interface{}) error {
- c := m.(*controller.ControllerCfg)
-
vinsId := uint64(d.Get("vins_id").(int))
- _, newStart := d.GetChange("vnfdev_start")
- if newStart.(bool) {
- req := vins.VNFDevStartRequest{VINSID: vinsId}
-
- _, err := c.CloudBroker().VINS().VNFDevStart(ctx, req)
- if err != nil {
- return err
- }
+ if d.Get("vnfdev_start").(bool) {
+ return resourceVinsVnfDevStart(ctx, m, vinsId)
}
+ return resourceVinsVnfDevStop(ctx, m, vinsId)
+}
+
+func resourceVinsVnfDevStart(ctx context.Context, m interface{}, vinsId uint64) error {
+ c := m.(*controller.ControllerCfg)
+
+ req := vins.VNFDevStartRequest{VINSID: vinsId}
+
+ _, err := c.CloudBroker().VINS().VNFDevStart(ctx, req)
+ return err
+}
+
+func resourceVinsVnfDevStop(ctx context.Context, m interface{}, vinsId uint64) error {
+ c := m.(*controller.ControllerCfg)
+
req := vins.VNFDevStopRequest{VINSID: vinsId}
_, err := c.CloudBroker().VINS().VNFDevStop(ctx, req)
diff --git a/internal/service/cloudbroker/vins/schema.go b/internal/service/cloudbroker/vins/schema.go
index b1324032..c955372d 100644
--- a/internal/service/cloudbroker/vins/schema.go
+++ b/internal/service/cloudbroker/vins/schema.go
@@ -404,6 +404,10 @@ func dataSourceVinsSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "default gw",
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"default_qos": {
Type: schema.TypeList,
Computed: true,
@@ -1321,6 +1325,10 @@ func dataSourceVinsListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"default_qos": {
Type: schema.TypeList,
Computed: true,
@@ -1577,6 +1585,10 @@ func dataSourceVinsListDeletedSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Computed: true,
+ },
"default_qos": {
Type: schema.TypeList,
Computed: true,
@@ -2177,7 +2189,6 @@ func resourceVinsSchemaMake() map[string]*schema.Schema {
"vnfdev_start": {
Type: schema.TypeBool,
Optional: true,
- Default: false,
Description: "true to start vnfdev, false to stop vnfdev",
},
"vnfdev_reset": {
@@ -2627,6 +2638,12 @@ func resourceVinsSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "default gw",
},
+ "enable_default_gateway": {
+ Type: schema.TypeBool,
+ Optional: true,
+ Default: true,
+ Description: "Flag indicating whether default gateway is enabled for this VINS",
+ },
"deleted_by": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudbroker/vins/utility_vins.go b/internal/service/cloudbroker/vins/utility_vins.go
index 63304fee..bb56512d 100644
--- a/internal/service/cloudbroker/vins/utility_vins.go
+++ b/internal/service/cloudbroker/vins/utility_vins.go
@@ -80,6 +80,9 @@ func utilityUpdateVINS(ctx context.Context, d *schema.ResourceData, m interface{
if d.HasChange("enable_secgroups") {
req.EnableSecGroups = d.Get("enable_secgroups").(bool)
}
+ if d.HasChange("enable_default_gateway") {
+ req.EnableDefaultGateway = d.Get("enable_default_gateway").(bool)
+ }
_, err := c.CloudBroker().VINS().Update(ctx, req)
if err != nil {
diff --git a/internal/service/cloudbroker/zone/data_source_zone.go b/internal/service/cloudbroker/zone/data_source_zone.go
index bc6a0c9a..c15c0420 100644
--- a/internal/service/cloudbroker/zone/data_source_zone.go
+++ b/internal/service/cloudbroker/zone/data_source_zone.go
@@ -194,6 +194,34 @@ func dataSourceZoneSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
}
}
diff --git a/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile.go b/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile.go
new file mode 100644
index 00000000..bb4a3800
--- /dev/null
+++ b/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile.go
@@ -0,0 +1,97 @@
+/*
+Copyright (c) 2019-2024 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package zone
+
+import (
+ "context"
+ "strconv"
+
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+)
+
+func dataSourceZoneCPUAlignmentProfileRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
+ profiles, err := utilityZoneCPUAlignmentProfileCheckPresence(ctx, d, m)
+ if err != nil {
+ d.SetId("")
+ return diag.FromErr(err)
+ }
+ d.SetId(strconv.Itoa(d.Get("zone_id").(int)))
+ d.Set("profiles", flattenCPUAlignmentProfiles(profiles))
+ return nil
+}
+
+func dataSourceZoneCPUAlignmentProfileSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "zone_id": {
+ Type: schema.TypeInt,
+ Required: true,
+ },
+ "profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ }
+}
+
+func DataSourceZoneCPUAlignmentProfile() *schema.Resource {
+ return &schema.Resource{
+ SchemaVersion: 1,
+
+ ReadContext: dataSourceZoneCPUAlignmentProfileRead,
+
+ Timeouts: &schema.ResourceTimeout{
+ Read: &constants.Timeout30s,
+ Default: &constants.Timeout60s,
+ },
+
+ Schema: dataSourceZoneCPUAlignmentProfileSchemaMake(),
+ }
+}
diff --git a/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile_list.go b/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile_list.go
new file mode 100644
index 00000000..7dd646a5
--- /dev/null
+++ b/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile_list.go
@@ -0,0 +1,115 @@
+/*
+Copyright (c) 2019-2024 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package zone
+
+import (
+ "context"
+
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
+
+ "github.com/google/uuid"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+)
+
+func dataSourceZoneCPUAlignmentProfileListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
+ list, err := utilityZoneCPUAlignmentProfileListCheckPresence(ctx, d, m)
+ if err != nil {
+ d.SetId("")
+ return diag.FromErr(err)
+ }
+ id := uuid.New()
+ d.SetId(id.String())
+ d.Set("items", flattenZoneCPUAlignmentProfileList(list))
+ d.Set("entry_count", list.EntryCount)
+ return nil
+}
+
+func dataSourceZoneCPUAlignmentProfileListSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "zone_id": {
+ Type: schema.TypeInt,
+ Optional: true,
+ },
+ "items": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "zone_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ "entry_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ }
+}
+
+func DataSourceZoneCPUAlignmentProfileList() *schema.Resource {
+ return &schema.Resource{
+ SchemaVersion: 1,
+
+ ReadContext: dataSourceZoneCPUAlignmentProfileListRead,
+
+ Timeouts: &schema.ResourceTimeout{
+ Read: &constants.Timeout30s,
+ Default: &constants.Timeout60s,
+ },
+
+ Schema: dataSourceZoneCPUAlignmentProfileListSchemaMake(),
+ }
+}
diff --git a/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile_test_ds.go b/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile_test_ds.go
new file mode 100644
index 00000000..2c7d0ba5
--- /dev/null
+++ b/internal/service/cloudbroker/zone/data_source_zone_cpu_alignment_profile_test_ds.go
@@ -0,0 +1,159 @@
+/*
+Copyright (c) 2019-2024 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package zone
+
+import (
+ "context"
+ "strconv"
+
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+)
+
+func dataSourceZoneCPUAlignmentProfileTestRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
+ result, err := utilityZoneCPUAlignmentProfileTestCheckPresence(ctx, d, m)
+ if err != nil {
+ d.SetId("")
+ return diag.FromErr(err)
+ }
+ d.SetId(strconv.Itoa(d.Get("zone_id").(int)))
+ d.Set("profiles", flattenCPUAlignmentProfiles(result.Profiles))
+ d.Set("candidates", flattenCPUAlignmentProfileCandidates(result.Candidates))
+ d.Set("supported_cpu_models", flattenSupportedCpuModels(result.SupportedCpuModels))
+ return nil
+}
+
+func dataSourceZoneCPUAlignmentProfileTestSchemaMake() map[string]*schema.Schema {
+ return map[string]*schema.Schema{
+ "zone_id": {
+ Type: schema.TypeInt,
+ Required: true,
+ },
+ "hypervisor_similarity_in_percentage": {
+ Type: schema.TypeInt,
+ Optional: true,
+ },
+ "profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "candidates": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "percentage": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ "required_count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "supported_cpu_models": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "count": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "percentage": {
+ Type: schema.TypeFloat,
+ Computed: true,
+ },
+ },
+ },
+ },
+ }
+}
+
+func DataSourceZoneCPUAlignmentProfileTest() *schema.Resource {
+ return &schema.Resource{
+ SchemaVersion: 1,
+
+ ReadContext: dataSourceZoneCPUAlignmentProfileTestRead,
+
+ Timeouts: &schema.ResourceTimeout{
+ Read: &constants.Timeout30s,
+ Default: &constants.Timeout60s,
+ },
+
+ Schema: dataSourceZoneCPUAlignmentProfileTestSchemaMake(),
+ }
+}
diff --git a/internal/service/cloudbroker/zone/data_source_zone_list.go b/internal/service/cloudbroker/zone/data_source_zone_list.go
index cfc00b54..04080c8b 100644
--- a/internal/service/cloudbroker/zone/data_source_zone_list.go
+++ b/internal/service/cloudbroker/zone/data_source_zone_list.go
@@ -202,6 +202,34 @@ func dataSourceZoneListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Computed: true,
+ },
},
},
},
diff --git a/internal/service/cloudbroker/zone/flattens.go b/internal/service/cloudbroker/zone/flattens.go
index 6cb1a597..e87305e8 100644
--- a/internal/service/cloudbroker/zone/flattens.go
+++ b/internal/service/cloudbroker/zone/flattens.go
@@ -38,6 +38,19 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/zone"
)
+func flattenSupportedCpuModels(models []zone.SupportedCpuModel) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(models))
+ for _, m := range models {
+ res = append(res, map[string]interface{}{
+ "vendor": m.Vendor,
+ "model": m.Model,
+ "count": int(m.Count),
+ "percentage": m.Percentage,
+ })
+ }
+ return res
+}
+
func flattenZone(d *schema.ResourceData, item *zone.RecordZone) error {
log.Debugf("flattenZone: start decoding RecordZone name %q / ID %d",
item.Name, item.ID)
@@ -71,39 +84,83 @@ func flattenZone(d *schema.ResourceData, item *zone.RecordZone) error {
d.Set("ssl_skip_verify", item.SSLSkipVerify)
d.Set("domain", item.Domain)
d.Set("sso_type", item.SSOType)
+ d.Set("cpu_alignment_profiles", flattenCPUAlignmentProfiles(item.CpuAlignmentProfiles))
+ d.Set("reserved_cpu", item.ReservedCPU)
+ d.Set("reserved_ram", item.ReservedRAM)
log.Debugf("flattenZone: decoded RecordZone name %q / ID %d, complete",
item.Name, item.ID)
return nil
}
+func flattenCPUAlignmentProfiles(profiles []zone.CpuAlignmentProfile) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(profiles))
+ for _, p := range profiles {
+ res = append(res, map[string]interface{}{
+ "name": p.Name,
+ "vendor": p.Vendor,
+ "model": p.Model,
+ })
+ }
+ return res
+}
+
+func flattenCPUAlignmentProfileCandidates(candidates []zone.CpuAlignmentProfileCandidate) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(candidates))
+ for _, c := range candidates {
+ res = append(res, map[string]interface{}{
+ "name": c.Name,
+ "vendor": c.Vendor,
+ "model": c.Model,
+ "count": int(c.Count),
+ "percentage": c.Percentage,
+ "required_count": int(c.RequiredCount),
+ })
+ }
+ return res
+}
+
+func flattenZoneCPUAlignmentProfileList(list *zone.ListCPUAlignmentProfiles) []map[string]interface{} {
+ res := make([]map[string]interface{}, 0, len(list.Data))
+ for _, item := range list.Data {
+ res = append(res, map[string]interface{}{
+ "zone_id": int(item.ZoneID),
+ "cpu_alignment_profiles": flattenCPUAlignmentProfiles(item.CpuAlignmentProfiles),
+ })
+ }
+ return res
+}
+
func flattenZoneList(zone *zone.ListZones) []map[string]interface{} {
log.Debugf("flattenZoneList start")
res := make([]map[string]interface{}, 0, len(zone.Data))
for _, zone := range zone.Data {
temp := map[string]interface{}{
- "zone_id": int(zone.ID),
- "guid": int(zone.GUID),
- "gid": int(zone.GID),
- "name": zone.Name,
- "description": zone.Description,
- "deletable": zone.Deletable,
- "status": zone.Status,
- "created_time": zone.CreatedTime,
- "updated_time": zone.UpdatedTime,
- "node_ids": zone.NodeIDs,
- "auto_start": zone.AutoStart,
- "drs": zone.DRS,
- "drs_uid": zone.DRSUID,
- "drs_name": zone.DRSName,
- "sso_url": zone.SSOURL,
- "app_id": zone.AppID,
- "decort_url": zone.DecortURL,
- "ping_addr": zone.PingAddr,
- "broadcast_addr": zone.BroadcastAddr,
- "ssl_skip_verify": zone.SSLSkipVerify,
- "domain": zone.Domain,
- "sso_type": zone.SSOType,
+ "zone_id": int(zone.ID),
+ "guid": int(zone.GUID),
+ "gid": int(zone.GID),
+ "name": zone.Name,
+ "description": zone.Description,
+ "deletable": zone.Deletable,
+ "status": zone.Status,
+ "created_time": zone.CreatedTime,
+ "updated_time": zone.UpdatedTime,
+ "node_ids": zone.NodeIDs,
+ "auto_start": zone.AutoStart,
+ "drs": zone.DRS,
+ "drs_uid": zone.DRSUID,
+ "drs_name": zone.DRSName,
+ "sso_url": zone.SSOURL,
+ "app_id": zone.AppID,
+ "decort_url": zone.DecortURL,
+ "ping_addr": zone.PingAddr,
+ "broadcast_addr": zone.BroadcastAddr,
+ "ssl_skip_verify": zone.SSLSkipVerify,
+ "domain": zone.Domain,
+ "sso_type": zone.SSOType,
+ "cpu_alignment_profiles": flattenCPUAlignmentProfiles(zone.CpuAlignmentProfiles),
+ "reserved_cpu": int(zone.ReservedCPU),
+ "reserved_ram": int(zone.ReservedRAM),
}
res = append(res, temp)
}
diff --git a/internal/service/cloudbroker/zone/resource_zone.go b/internal/service/cloudbroker/zone/resource_zone.go
index 05d3f346..f127f506 100644
--- a/internal/service/cloudbroker/zone/resource_zone.go
+++ b/internal/service/cloudbroker/zone/resource_zone.go
@@ -97,6 +97,22 @@ func resourceZoneCreate(ctx context.Context, d *schema.ResourceData, m interface
}
}
+ if similarity, ok := d.GetOk("hypervisor_similarity_in_percentage"); ok {
+ if s := similarity.(int); s > 0 {
+ if err := utilityZoneCPUAlignmentProfileAdd(ctx, m, zoneID, uint64(s)); err != nil {
+ warnings.Add(err)
+ }
+ }
+ }
+
+ if _, cpuOk := d.GetOk("reserved_cpu"); cpuOk {
+ if _, ramOk := d.GetOk("reserved_ram"); ramOk {
+ if err := utilityZoneSetResourcesLimit(ctx, d, m, zoneID); err != nil {
+ warnings.Add(err)
+ }
+ }
+ }
+
log.Debugf("resourceZoneCreate: create Zone with ID: %d, complete", zoneID)
return append(resourceZoneRead(ctx, d, m), warnings.Get()...)
}
@@ -127,6 +143,18 @@ func resourceZoneUpdate(ctx context.Context, d *schema.ResourceData, m interface
}
}
+ if d.HasChange("hypervisor_similarity_in_percentage") {
+ if err := utilityZoneCPUAlignmentProfileUpdate(ctx, d, m, zoneID); err != nil {
+ return diag.FromErr(err)
+ }
+ }
+
+ if d.HasChanges("reserved_cpu", "reserved_ram") {
+ if err := utilityZoneSetResourcesLimit(ctx, d, m, zoneID); err != nil {
+ return diag.FromErr(err)
+ }
+ }
+
log.Debugf("resourceZoneUpdate: update Zone with id %d, complete", zoneID)
return resourceZoneRead(ctx, d, m)
@@ -279,6 +307,40 @@ func resourceZoneSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "hypervisor_similarity_in_percentage": {
+ Type: schema.TypeInt,
+ Optional: true,
+ },
+ "reserved_cpu": {
+ Type: schema.TypeInt,
+ Optional: true,
+ RequiredWith: []string{"reserved_ram"},
+ },
+ "reserved_ram": {
+ Type: schema.TypeInt,
+ Optional: true,
+ RequiredWith: []string{"reserved_cpu"},
+ },
+ "cpu_alignment_profiles": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "vendor": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ "model": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
+ },
+ },
+ },
"id": {
Type: schema.TypeString,
Computed: true,
diff --git a/internal/service/cloudbroker/zone/utility_zone.go b/internal/service/cloudbroker/zone/utility_zone.go
index 7c4dc595..b2aafb78 100644
--- a/internal/service/cloudbroker/zone/utility_zone.go
+++ b/internal/service/cloudbroker/zone/utility_zone.go
@@ -146,6 +146,73 @@ func utilityZoneUpdate(ctx context.Context, d *schema.ResourceData, m interface{
return nil
}
+func utilityZoneCPUAlignmentProfileAdd(ctx context.Context, m interface{}, zoneID uint64, similarity uint64) error {
+ c := m.(*controller.ControllerCfg)
+
+ req := zone.AddCPUAlignmentProfileRequest{
+ ZoneID: zoneID,
+ HypervisorSimilarityInPercentage: similarity,
+ }
+ if _, err := c.CloudBroker().Zone().AddCPUAlignmentProfile(ctx, req); err != nil {
+ return err
+ }
+ log.Debugf("utilityZoneCPUAlignmentProfileAdd: added CPU alignment profile for zone %d with similarity %d%%", zoneID, similarity)
+ return nil
+}
+
+func utilityZoneCPUAlignmentProfileUpdate(ctx context.Context, d *schema.ResourceData, m interface{}, zoneID uint64) error {
+ c := m.(*controller.ControllerCfg)
+
+ oldRaw, newRaw := d.GetChange("hypervisor_similarity_in_percentage")
+ oldVal := oldRaw.(int)
+ newVal := newRaw.(int)
+
+ if newVal == 0 {
+ req := zone.DeleteCPUAlignmentProfileRequest{
+ ZoneID: zoneID,
+ }
+ if _, err := c.CloudBroker().Zone().DeleteCPUAlignmentProfile(ctx, req); err != nil {
+ return err
+ }
+ log.Debugf("utilityZoneCPUAlignmentProfileUpdate: deleted CPU alignment profile for zone %d", zoneID)
+ return nil
+ }
+
+ if oldVal == 0 {
+ if err := utilityZoneCPUAlignmentProfileAdd(ctx, m, zoneID, uint64(newVal)); err != nil {
+ return err
+ }
+ } else {
+ req := zone.UpdateCPUAlignmentProfileRequest{
+ ZoneID: zoneID,
+ HypervisorSimilarityInPercentage: uint64(newVal),
+ }
+ if _, err := c.CloudBroker().Zone().UpdateCPUAlignmentProfile(ctx, req); err != nil {
+ return err
+ }
+ log.Debugf("utilityZoneCPUAlignmentProfileUpdate: updated CPU alignment profile for zone %d with similarity %d%%", zoneID, newVal)
+ }
+
+ return nil
+}
+
+func utilityZoneSetResourcesLimit(ctx context.Context, d *schema.ResourceData, m interface{}, zoneID uint64) error {
+ c := m.(*controller.ControllerCfg)
+
+ req := zone.SetResourcesLimitRequest{
+ ZoneID: zoneID,
+ ReservedCPU: uint64(d.Get("reserved_cpu").(int)),
+ ReservedRAM: uint64(d.Get("reserved_ram").(int)),
+ }
+
+ if _, err := c.CloudBroker().Zone().SetResourcesLimit(ctx, req); err != nil {
+ return err
+ }
+
+ log.Debugf("utilityZoneSetResourcesLimit: set resources limit for zone %d (cpu=%d, ram=%d)", zoneID, req.ReservedCPU, req.ReservedRAM)
+ return nil
+}
+
func containsNodes(set []interface{}, check interface{}) bool {
for _, elem := range set {
elemConv := elem.(int)
diff --git a/internal/service/cloudbroker/zone/utility_zone_cpu_alignment_profile.go b/internal/service/cloudbroker/zone/utility_zone_cpu_alignment_profile.go
new file mode 100644
index 00000000..1a48be6b
--- /dev/null
+++ b/internal/service/cloudbroker/zone/utility_zone_cpu_alignment_profile.go
@@ -0,0 +1,77 @@
+/*
+Copyright (c) 2019-2024 Digital Energy Cloud Solutions LLC. All Rights Reserved.
+Authors:
+Petr Krutov,
+Stanislav Solovev,
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+/*
+Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
+Orchestration Technology) with Terraform by Hashicorp.
+
+Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
+
+Please see README.md to learn where to place source code so that it
+builds seamlessly.
+
+Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
+*/
+
+package zone
+
+import (
+ "context"
+
+ "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/zone"
+ "repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+)
+
+func utilityZoneCPUAlignmentProfileCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) ([]zone.CpuAlignmentProfile, error) {
+ c := m.(*controller.ControllerCfg)
+
+ req := zone.GetCPUAlignmentProfileRequest{
+ ZoneID: uint64(d.Get("zone_id").(int)),
+ }
+
+ return c.CloudBroker().Zone().GetCPUAlignmentProfile(ctx, req)
+}
+
+func utilityZoneCPUAlignmentProfileListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*zone.ListCPUAlignmentProfiles, error) {
+ c := m.(*controller.ControllerCfg)
+
+ req := zone.ListCPUAlignmentProfileRequest{}
+
+ if zoneID, ok := d.GetOk("zone_id"); ok {
+ req.ZoneID = uint64(zoneID.(int))
+ }
+
+ return c.CloudBroker().Zone().ListCPUAlignmentProfile(ctx, req)
+}
+
+func utilityZoneCPUAlignmentProfileTestCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*zone.TestCPUAlignmentProfileResult, error) {
+ c := m.(*controller.ControllerCfg)
+
+ req := zone.TestCPUAlignmentProfileRequest{
+ ZoneID: uint64(d.Get("zone_id").(int)),
+ }
+
+ if similarity, ok := d.GetOk("hypervisor_similarity_in_percentage"); ok {
+ req.HypervisorSimilarityInPercentage = uint64(similarity.(int))
+ }
+
+ return c.CloudBroker().Zone().TestCPUAlignmentProfile(ctx, req)
+}
diff --git a/internal/service/sdn/logicalports/schema.go b/internal/service/sdn/logicalports/schema.go
index be3465f9..c4895e2d 100644
--- a/internal/service/sdn/logicalports/schema.go
+++ b/internal/service/sdn/logicalports/schema.go
@@ -74,6 +74,134 @@ func excludeFirewallSchema() *schema.Schema {
}
}
+func statusSchema() *schema.Schema {
+ return &schema.Schema{
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "operation_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Operation status",
+ },
+ "hypervisor_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Hypervisor status",
+ },
+ "hypervisors": {
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "operation_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Operation status of the hypervisor",
+ },
+ "name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Name of the hypervisor",
+ },
+ "display_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Display name of the hypervisor",
+ },
+ "hypervisor_status": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Status of the hypervisor",
+ },
+ "synced_at": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Sync time of the hypervisor",
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func bindingsSchema() *schema.Schema {
+ return &schema.Schema{
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Unique identifier of the binding",
+ },
+ "segment_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Unique identifier of the segment",
+ },
+ "segment_display_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Display name of the segment",
+ },
+ "port_security": {
+ Type: schema.TypeBool,
+ Computed: true,
+ Description: "If the port is secured",
+ },
+ "address_detection": {
+ Type: schema.TypeBool,
+ Computed: true,
+ Description: "If the adapter address detection is enabled",
+ },
+ "version_id": {
+ Type: schema.TypeInt,
+ Computed: true,
+ Description: "Version ID of the binding",
+ },
+ "created_at": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Creation time of the binding",
+ },
+ "updated_at": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "Update time of the binding",
+ },
+ "logical_port_addresses": logicalPortAddressesSchema(),
+ },
+ },
+ }
+}
+
+func computedLabelsSchema() *schema.Schema {
+ return &schema.Schema{
+ Type: schema.TypeList,
+ Computed: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "vm_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "VM ID label",
+ },
+ "vm_name": {
+ Type: schema.TypeString,
+ Computed: true,
+ Description: "VM name label",
+ },
+ },
+ },
+ Description: "Labels",
+ }
+}
+
func resourceLogicalPortSchemaMake() map[string]*schema.Schema {
res := map[string]*schema.Schema{
"access_group_id": {
@@ -200,15 +328,11 @@ func resourceLogicalPortSchemaMake() map[string]*schema.Schema {
Type: schema.TypeBool,
Computed: true,
},
+ "exclude_firewall": excludeFirewallSchema(),
"created_at": {
Type: schema.TypeString,
Computed: true,
},
- "updated_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Last update time of the logical port",
- },
"external_network_id": {
Type: schema.TypeString,
Computed: true,
@@ -221,107 +345,8 @@ func resourceLogicalPortSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "exclude_firewall": excludeFirewallSchema(),
- "status": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Hypervisor status",
- },
- "hypervisors": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status of the hypervisor",
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Name of the hypervisor",
- },
- "display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the hypervisor",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Status of the hypervisor",
- },
- "synced_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Sync time of the hypervisor",
- },
- },
- },
- },
- },
- },
- },
- "bindings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the binding",
- },
- "segment_id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the segment",
- },
- "segment_display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the segment",
- },
- "port_security": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the port is secured",
- },
- "address_detection": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the adapter address detection is enabled",
- },
- "version_id": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "Version ID of the binding",
- },
- "created_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Creation time of the binding",
- },
- "updated_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Update time of the binding",
- },
- "logical_port_addresses": logicalPortAddressesSchema(),
- },
- },
- },
+ "status": statusSchema(),
+ "bindings": bindingsSchema(),
"version_id": {
Type: schema.TypeInt,
Computed: true,
@@ -337,13 +362,11 @@ func resourceLogicalPortSchemaMake() map[string]*schema.Schema {
"vm_id": {
Type: schema.TypeString,
Optional: true,
- Computed: true,
Description: "VM ID label",
},
"vm_name": {
Type: schema.TypeString,
Optional: true,
- Computed: true,
Description: "VM name label",
},
},
@@ -492,6 +515,7 @@ func dataSourceLogicalPortListSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "If the adapter address detection is enabled",
},
+ "exclude_firewall": excludeFirewallSchema(),
"description": {
Type: schema.TypeString,
Computed: true,
@@ -525,57 +549,7 @@ func dataSourceLogicalPortListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "status": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Hypervisor status",
- },
- "hypervisors": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status of the hypervisor",
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Name of the hypervisor",
- },
- "display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the hypervisor",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Status of the hypervisor",
- },
- "synced_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Sync time of the hypervisor",
- },
- },
- },
- },
- },
- },
- },
+ "status": statusSchema(),
"unique_identifier": {
Type: schema.TypeString,
Computed: true,
@@ -586,55 +560,7 @@ func dataSourceLogicalPortListSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Version ID of the logical port",
},
- "bindings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the binding",
- },
- "segment_id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the segment",
- },
- "segment_display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the segment",
- },
- "port_security": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the port is secured",
- },
- "address_detection": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the adapter address detection is enabled",
- },
- "version_id": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "Version ID of the binding",
- },
- "created_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Creation time of the binding",
- },
- "updated_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Update time of the binding",
- },
- "logical_port_addresses": logicalPortAddressesSchema(),
- },
- },
- },
+ "bindings": bindingsSchema(),
"created_at": {
Type: schema.TypeString,
Computed: true,
@@ -645,25 +571,7 @@ func dataSourceLogicalPortListSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Update time the logical port",
},
- "labels": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "vm_id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "VM ID label",
- },
- "vm_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "VM name label",
- },
- },
- },
- Description: "Labels",
- },
+ "labels": computedLabelsSchema(),
},
},
},
@@ -698,6 +606,7 @@ func dataSourceLogicalPortByUniqueIDSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "If the adapter address detection is enabled",
},
+ "exclude_firewall": excludeFirewallSchema(),
"description": {
Type: schema.TypeString,
Computed: true,
@@ -731,111 +640,13 @@ func dataSourceLogicalPortByUniqueIDSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "status": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Hypervisor status",
- },
- "hypervisors": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status of the hypervisor",
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Name of the hypervisor",
- },
- "display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the hypervisor",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Status of the hypervisor",
- },
- "synced_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Sync time of the hypervisor",
- },
- },
- },
- },
- },
- },
- },
+ "status": statusSchema(),
"version_id": {
Type: schema.TypeInt,
Computed: true,
Description: "Version ID of the logical port",
},
- "bindings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the binding",
- },
- "segment_id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the segment",
- },
- "segment_display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the segment",
- },
- "port_security": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the port is secured",
- },
- "address_detection": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the adapter address detection is enabled",
- },
- "version_id": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "Version ID of the binding",
- },
- "created_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Creation time of the binding",
- },
- "updated_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Update time of the binding",
- },
- "logical_port_addresses": logicalPortAddressesSchema(),
- },
- },
- },
+ "bindings": bindingsSchema(),
"created_at": {
Type: schema.TypeString,
Computed: true,
@@ -846,25 +657,7 @@ func dataSourceLogicalPortByUniqueIDSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Update time the logical port",
},
- "labels": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "vm_id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "VM ID label",
- },
- "vm_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "VM name label",
- },
- },
- },
- Description: "Labels",
- },
+ "labels": computedLabelsSchema(),
}
return res
}
@@ -896,6 +689,7 @@ func dataSourceLogicalPortSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "If the adapter address detection is enabled",
},
+ "exclude_firewall": excludeFirewallSchema(),
"description": {
Type: schema.TypeString,
Computed: true,
@@ -929,57 +723,7 @@ func dataSourceLogicalPortSchemaMake() map[string]*schema.Schema {
Type: schema.TypeString,
Computed: true,
},
- "status": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Hypervisor status",
- },
- "hypervisors": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "operation_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Operation status of the hypervisor",
- },
- "name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Name of the hypervisor",
- },
- "display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the hypervisor",
- },
- "hypervisor_status": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Status of the hypervisor",
- },
- "synced_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Sync time of the hypervisor",
- },
- },
- },
- },
- },
- },
- },
+ "status": statusSchema(),
"unique_identifier": {
Type: schema.TypeString,
Computed: true,
@@ -990,55 +734,7 @@ func dataSourceLogicalPortSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Version ID of the logical port",
},
- "bindings": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the binding",
- },
- "segment_id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Unique identifier of the segment",
- },
- "segment_display_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Display name of the segment",
- },
- "port_security": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the port is secured",
- },
- "address_detection": {
- Type: schema.TypeBool,
- Computed: true,
- Description: "If the adapter address detection is enabled",
- },
- "version_id": {
- Type: schema.TypeInt,
- Computed: true,
- Description: "Version ID of the binding",
- },
- "created_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Creation time of the binding",
- },
- "updated_at": {
- Type: schema.TypeString,
- Computed: true,
- Description: "Update time of the binding",
- },
- "logical_port_addresses": logicalPortAddressesSchema(),
- },
- },
- },
+ "bindings": bindingsSchema(),
"created_at": {
Type: schema.TypeString,
Computed: true,
@@ -1049,25 +745,7 @@ func dataSourceLogicalPortSchemaMake() map[string]*schema.Schema {
Computed: true,
Description: "Update time the logical port",
},
- "labels": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "vm_id": {
- Type: schema.TypeString,
- Computed: true,
- Description: "VM ID label",
- },
- "vm_name": {
- Type: schema.TypeString,
- Computed: true,
- Description: "VM name label",
- },
- },
- },
- Description: "Labels",
- },
+ "labels": computedLabelsSchema(),
}
return res
}
diff --git a/internal/service/sdn/netobjgroups/computed_schemas.go b/internal/service/sdn/netobjgroups/computed_schemas.go
index e545cd24..7e4d741d 100644
--- a/internal/service/sdn/netobjgroups/computed_schemas.go
+++ b/internal/service/sdn/netobjgroups/computed_schemas.go
@@ -542,30 +542,16 @@ func externalNetworkPortsComputedSchema() *schema.Schema {
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
- "id": {Type: schema.TypeString, Computed: true},
- "access_group_id": {Type: schema.TypeString, Computed: true},
- "access_group_name": {Type: schema.TypeString, Computed: true},
- "bridge_network_name": {Type: schema.TypeString, Computed: true},
- "comment": {Type: schema.TypeString, Computed: true},
- "default_gateway_ipv4": {Type: schema.TypeString, Computed: true},
- "default_gateway_ipv6": {Type: schema.TypeString, Computed: true},
- "description": {Type: schema.TypeString, Computed: true},
- "enabled": {Type: schema.TypeBool, Computed: true},
- "external_network_ports": externalNetworkPortFieldsComputedSchema(),
- "hypervisors": {
- Type: schema.TypeList,
- Computed: true,
- Elem: &schema.Schema{Type: schema.TypeString},
- },
- "ipv4": {Type: schema.TypeString, Computed: true},
- "status": statusComputedSchema(),
- "version_id": {Type: schema.TypeInt, Computed: true},
- "subnet_v4": {Type: schema.TypeString, Computed: true},
- "subnet_v6": {Type: schema.TypeString, Computed: true},
- "created_at": {Type: schema.TypeString, Computed: true},
- "updated_at": {Type: schema.TypeString, Computed: true},
- "vlan_tag": {Type: schema.TypeInt, Computed: true},
- "mac": {Type: schema.TypeString, Computed: true},
+ "id": {Type: schema.TypeString, Computed: true},
+ "access_group_id": {Type: schema.TypeString, Computed: true},
+ "access_group_name": {Type: schema.TypeString, Computed: true},
+ "comment": {Type: schema.TypeString, Computed: true},
+ "display_name": {Type: schema.TypeString, Computed: true},
+ "enabled": {Type: schema.TypeBool, Computed: true},
+ "external_network_id": {Type: schema.TypeString, Computed: true},
+ "ipv4": {Type: schema.TypeString, Computed: true},
+ "version_id": {Type: schema.TypeInt, Computed: true},
+ "mac": {Type: schema.TypeString, Computed: true},
},
},
}
diff --git a/internal/service/sdn/netobjgroups/decort_sdn_network_object_group_list.go b/internal/service/sdn/netobjgroups/decort_sdn_network_object_group_list.go
index b997fdb6..40180477 100644
--- a/internal/service/sdn/netobjgroups/decort_sdn_network_object_group_list.go
+++ b/internal/service/sdn/netobjgroups/decort_sdn_network_object_group_list.go
@@ -102,6 +102,10 @@ func dataSourceNetworkObjectGroupListSchemaMake() map[string]*schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
+ "type": {
+ Type: schema.TypeString,
+ Optional: true,
+ },
"items": {
Type: schema.TypeList,
Computed: true,
diff --git a/internal/service/sdn/netobjgroups/flattens.go b/internal/service/sdn/netobjgroups/flattens.go
index a578ecb1..a37806d2 100644
--- a/internal/service/sdn/netobjgroups/flattens.go
+++ b/internal/service/sdn/netobjgroups/flattens.go
@@ -405,31 +405,16 @@ func flattenExternalNetworkPortFields(ports netobjgroups.ExternalNetworkPortsFie
func flattenExternalNetworkPorts(ports netobjgroups.ExternalNetworkPorts) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(ports))
for _, p := range ports {
- hypervisors := make([]interface{}, 0, len(p.Hypervisors))
- for _, h := range p.Hypervisors {
- hypervisors = append(hypervisors, h)
- }
res = append(res, map[string]interface{}{
- "id": p.ID,
- "access_group_id": p.AccessGroupID,
- "access_group_name": p.AccessGroupName,
- "bridge_network_name": p.BridgeNetworkName,
- "comment": p.Comment,
- "default_gateway_ipv4": p.DefaultGatewayIPv4,
- "default_gateway_ipv6": p.DefaultGatewayIPv6,
- "description": p.Description,
- "enabled": p.Enabled,
- "external_network_ports": flattenExternalNetworkPortFields(p.ExternalNetworkPorts),
- "hypervisors": hypervisors,
- "ipv4": p.IPv4,
- "status": flattenStatus(p.Status),
- "version_id": int(p.VersionID),
- "subnet_v4": p.SubnetV4,
- "subnet_v6": p.SubnetV6,
- "created_at": p.CreatedAt,
- "updated_at": p.UpdatedAt,
- "vlan_tag": p.VLANTag,
- "mac": p.MAC,
+ "id": p.ID,
+ "access_group_id": p.AccessGroupID,
+ "access_group_name": p.AccessGroupName,
+ "comment": p.Comment,
+ "display_name": p.DisplayName,
+ "enabled": p.Enabled,
+ "ipv4": p.IPv4,
+ "mac": p.MAC,
+ "version_id": int(p.VersionID),
})
}
return res
diff --git a/internal/service/sdn/netobjgroups/utility_network_object_group_list.go b/internal/service/sdn/netobjgroups/utility_network_object_group_list.go
index e9019013..817192da 100644
--- a/internal/service/sdn/netobjgroups/utility_network_object_group_list.go
+++ b/internal/service/sdn/netobjgroups/utility_network_object_group_list.go
@@ -77,6 +77,10 @@ func utilityNetworkObjectGroupListCheckPresence(ctx context.Context, d *schema.R
req.UpdatedTo = updatedTo.(string)
}
+ if typeObj, ok := d.GetOk("type"); ok {
+ req.Type = typeObj.(string)
+ }
+
log.Debugf("utilityNetworkObjectGroupListCheckPresence")
list, err := c.SDN().NetworkObjectGroups().List(ctx, req)
if err != nil {
diff --git a/samples/README.md b/samples/README.md
index 5112faa3..3abaaa06 100644
--- a/samples/README.md
+++ b/samples/README.md
@@ -68,6 +68,7 @@
- kvmvm_snapshot_usage
- kvmvm_user_list
- kvmvm_vgpu_list
+ - kvmvm_cpu_alignment_profile
- lb
- lb_list
- lb_list_deleted
@@ -209,11 +210,14 @@
- cb_kvmvm_snapshot_usage
- cb_kvmvm_user_list
- cb_kvmvm_vgpu_list
+ - cb_kvmvm_cpu_alignment_profile
- cb_lb
- cb_lb_list
- cb_lb_list_deleted
- cb_node
- cb_node_list
+ - cb_node_network_info
+ - cb_node_pci_devices
- cb_pcidevice
- cb_pcidevice_list
- cb_rg
@@ -259,6 +263,9 @@
- cb_vins_static_route_list
- cb_zone
- cb_zone_list
+ - cb_zone_cpu_alignment_profile
+ - cb_zone_cpu_alignment_profile_list
+ - cb_zone_cpu_alignment_profile_test
- resources:
- cb_account
- cb_cdrom_image
@@ -317,6 +324,24 @@
- sdn_hypervisor
- sdn_network_object_group
+## Deprecated datasources
+
+Следующие datasources являются **deprecated** и будут удалены в terraform-provider-decort **4.14.0**:
+
+- cloudapi:
+ - `decort_account_audits_list` (вместо него — `decort_audit_list`)
+ - `decort_kvmvm_get_audits` (вместо него — `decort_audit_list`)
+ - `decort_rg_audits` (вместо него — `decort_audit_list`)
+ - `decort_vins_audits` (вместо него — `decort_audit_list`)
+ - `decort_account_consumed_units_by_type`
+ - `decort_account_reserved_units`
+- cloudbroker:
+ - `decort_cb_account_audits_list` (вместо него — `decort_cb_audit_list`)
+ - `decort_cb_kvmvm_audits` (вместо него — `decort_cb_audit_list`)
+ - `decort_cb_kvmvm_get_audits` (вместо него — `decort_cb_audit_list`)
+ - `decort_cb_kvmvm_get_log`
+ - `decort_cb_grid_list_emails`
+
## Как пользоваться примерами
1. Установить terraform
diff --git a/samples/cloudapi/account/data_account_audits_list/main.tf b/samples/cloudapi/account/data_account_audits_list/main.tf
index 1ea2d735..86d331ce 100644
--- a/samples/cloudapi/account/data_account_audits_list/main.tf
+++ b/samples/cloudapi/account/data_account_audits_list/main.tf
@@ -1,6 +1,6 @@
/*Deprecated
-Данный datasource является **deprecated** и будет удалён в следующих версиях. Вместо него неоходимо использовать datasource **decort_audit_list**.
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**. Вместо него неоходимо использовать datasource **decort_audit_list**.
*/
/*
diff --git a/samples/cloudapi/account/data_account_consumed_units_by_type/main.tf b/samples/cloudapi/account/data_account_consumed_units_by_type/main.tf
index d74264f0..dc96436b 100644
--- a/samples/cloudapi/account/data_account_consumed_units_by_type/main.tf
+++ b/samples/cloudapi/account/data_account_consumed_units_by_type/main.tf
@@ -1,3 +1,8 @@
+/*Deprecated
+
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**.
+*/
+
/*
Пример использования
Ресурса cdrom image
diff --git a/samples/cloudapi/account/data_account_reserved_units/main.tf b/samples/cloudapi/account/data_account_reserved_units/main.tf
index 3966bef1..ade57d26 100644
--- a/samples/cloudapi/account/data_account_reserved_units/main.tf
+++ b/samples/cloudapi/account/data_account_reserved_units/main.tf
@@ -1,3 +1,8 @@
+/*Deprecated
+
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**.
+*/
+
/*
Пример использования
Получение информации о зарезервированных вычислительных мощностях
diff --git a/samples/cloudapi/image/data_image_list/main.tf b/samples/cloudapi/image/data_image_list/main.tf
index 42e36c99..4fef3b05 100644
--- a/samples/cloudapi/image/data_image_list/main.tf
+++ b/samples/cloudapi/image/data_image_list/main.tf
@@ -55,8 +55,8 @@ data "decort_image_list" "il" {
#фильтр по типу образа
#опциональный параметр
- #тип - строка
- #type_image = "cdrom"
+ #тип - массив строк
+ #type_image = ["linux", "windows"]
#фильтр по размеру образа
#опциональный параметр
diff --git a/samples/cloudapi/image/resource_image_virtual/main.tf b/samples/cloudapi/image/resource_image_virtual/main.tf
index 789b6c0f..d8a6ef06 100644
--- a/samples/cloudapi/image/resource_image_virtual/main.tf
+++ b/samples/cloudapi/image/resource_image_virtual/main.tf
@@ -44,11 +44,10 @@ resource "decort_image_virtual" "iv" {
link_to = 123
#id аккаунта
- #опциональный параметр
- #значение по умолчанию - 0
- #тип - целое число
+ #обязательный параметр
+ #тип - целое число
#используется при создании
- #account_id = 123
+ account_id = 123
}
diff --git a/samples/cloudapi/k8s/resource_k8s/main.tf b/samples/cloudapi/k8s/resource_k8s/main.tf
index 302abb99..c3bd2987 100644
--- a/samples/cloudapi/k8s/resource_k8s/main.tf
+++ b/samples/cloudapi/k8s/resource_k8s/main.tf
@@ -46,6 +46,7 @@ resource "decort_k8s" "cluster" {
#обязательный параметр
#тип - целое число
#используется при создании
+ #максимально поддерживаемая версия Kubernetes < 1.29
k8sci_id = 9
#сетевой плагин
diff --git a/samples/cloudapi/k8s/resource_k8s_cp/main.tf b/samples/cloudapi/k8s/resource_k8s_cp/main.tf
index 1e7af125..2435a036 100644
--- a/samples/cloudapi/k8s/resource_k8s_cp/main.tf
+++ b/samples/cloudapi/k8s/resource_k8s_cp/main.tf
@@ -42,6 +42,7 @@ resource "decort_k8s_cp" "cp" {
#обязательный параметр
#тип - целое число
#используется при создании
+ #максимально поддерживаемая версия Kubernetes < 1.29
k8sci_id = 55
#плагин сети (flannel, weavenet или calico)
diff --git a/samples/cloudapi/kvmvm/data_kvmvm_cpu_alignment_profile/main.tf b/samples/cloudapi/kvmvm/data_kvmvm_cpu_alignment_profile/main.tf
new file mode 100644
index 00000000..7d8d176c
--- /dev/null
+++ b/samples/cloudapi/kvmvm/data_kvmvm_cpu_alignment_profile/main.tf
@@ -0,0 +1,38 @@
+/*
+Пример использования
+Получение данных о профиле CPU alignment виртуальной машины
+*/
+
+#Раскомментируйте этот код,
+#и внесите необходимые правки в версию и путь,
+#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
+/*
+
+terraform {
+ required_providers {
+ decort = {
+ source = "basis/decort/decort"
+ version = ""
+ }
+ }
+}
+*/
+provider "decort" {
+ authenticator = "decs3o"
+ #controller_url =
+ controller_url = "https://ds1.digitalenergy.online"
+ #oauth2_url =
+ oauth2_url = "https://sso.digitalenergy.online"
+ allow_unverified_ssl = true
+}
+
+data "decort_kvmvm_cpu_alignment_profile" "cpu_alignment_profile" {
+ #id виртуальной машины
+ #обязательный параметр
+ #тип - целое число
+ compute_id = 100
+}
+
+output "output" {
+ value = data.decort_kvmvm_cpu_alignment_profile.cpu_alignment_profile
+}
diff --git a/samples/cloudapi/kvmvm/data_kvmvm_get_audits/main.tf b/samples/cloudapi/kvmvm/data_kvmvm_get_audits/main.tf
index 0a194885..fd87eb05 100644
--- a/samples/cloudapi/kvmvm/data_kvmvm_get_audits/main.tf
+++ b/samples/cloudapi/kvmvm/data_kvmvm_get_audits/main.tf
@@ -1,3 +1,8 @@
+/*Deprecated
+
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**. Вместо него неоходимо использовать datasource **decort_audit_list**.
+*/
+
/*
Пример использования
Получение данных об аудитах compute (виртуальной машине)
diff --git a/samples/cloudapi/kvmvm/resource_kvmvm/main.tf b/samples/cloudapi/kvmvm/resource_kvmvm/main.tf
index d4ae931b..9a152538 100644
--- a/samples/cloudapi/kvmvm/resource_kvmvm/main.tf
+++ b/samples/cloudapi/kvmvm/resource_kvmvm/main.tf
@@ -69,6 +69,13 @@ resource "decort_kvmvm" "comp" {
#используется при создании и обновлении
#chipset = "i440fx"
+ #тип часов для ВМ
+ #опциональный параметр
+ #возможные значения: "default", "linux", "windows", "none"
+ #по умолчанию - "default"
+ #используется при создании и обновлении
+ #clock = "linux"
+
#размер загрузочного диска
#опциональный параметр
#тип - целое число
@@ -197,6 +204,13 @@ resource "decort_kvmvm" "comp" {
#тип - булев
#permanently = false
+ #монтирование диска в режиме read only
+ #используется только при добавлении нового диска к существующей ВМ
+ #опциональный параметр
+ #тип - булев
+ #по умолчанию - false
+ #read_only = true
+
#блок для управления IO-лимитами диска
#опциональный параметр
#тип - блок
@@ -293,6 +307,11 @@ resource "decort_kvmvm" "comp" {
#используется при создании и обновлении
#affinity_label = "test4"
+ #имя профиля CPU alignment
+ #опциональный параметр
+ #тип - строка
+ #используется при создании и обновлении
+ #cpu_alignment_profile = "balanced"
#id экстра дисков
#опциональный параметр
@@ -354,6 +373,13 @@ resource "decort_kvmvm" "comp" {
#тип - булев
#enabled = true
+ #выключение шлюза по умолчанию на интерфейсе
+ #используется только с сетями типа "VINS"
+ #по умолчанию - true
+ #опциональный параметр
+ #тип - булев
+ #enable_default_gateway = false
+
#маска подсети
#используется только с сетями типа "DPDK" и "VFNIC"
#опциональный параметр
diff --git a/samples/cloudapi/rg/data_rg_audits/main.tf b/samples/cloudapi/rg/data_rg_audits/main.tf
index ed9916b6..e78e6381 100644
--- a/samples/cloudapi/rg/data_rg_audits/main.tf
+++ b/samples/cloudapi/rg/data_rg_audits/main.tf
@@ -1,6 +1,6 @@
/*Deprecated
-Данный datasource является **deprecated** и будет удалён в следующих версиях. Вместо него неоходимо использовать datasource **decort_audit_list**.
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**. Вместо него неоходимо использовать datasource **decort_audit_list**.
*/
/*
diff --git a/samples/cloudapi/rg/resource_rg/main.tf b/samples/cloudapi/rg/resource_rg/main.tf
index 994d1853..54afe1d9 100644
--- a/samples/cloudapi/rg/resource_rg/main.tf
+++ b/samples/cloudapi/rg/resource_rg/main.tf
@@ -208,6 +208,12 @@ resource "decort_resgroup" "rg" {
#значение по умолчанию - -1
#limit = 111
#}
+
+ #включение шлюза по умолчанию
+ #опциональный параметр
+ #тип - булев
+ #используется при создании
+ #enable_default_gateway = false
}
diff --git a/samples/cloudapi/vins/data_vins_audits/main.tf b/samples/cloudapi/vins/data_vins_audits/main.tf
index e459c5c7..21c14792 100644
--- a/samples/cloudapi/vins/data_vins_audits/main.tf
+++ b/samples/cloudapi/vins/data_vins_audits/main.tf
@@ -1,6 +1,6 @@
/*Deprecated
-Данный datasource является **deprecated** и будет удалён в следующих версиях. Вместо него неоходимо использовать datasource **decort_audit_list**.
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**. Вместо него неоходимо использовать datasource **decort_audit_list**.
*/
/*
diff --git a/samples/cloudapi/vins/resource_vins/main.tf b/samples/cloudapi/vins/resource_vins/main.tf
index a0c375b9..b4419520 100644
--- a/samples/cloudapi/vins/resource_vins/main.tf
+++ b/samples/cloudapi/vins/resource_vins/main.tf
@@ -201,6 +201,12 @@ resource "decort_vins" "vins" {
#значение по умолчанию - false
#enable_secgroups = false
+ #включение шлюза по умолчанию
+ #опциональный параметр
+ #тип - булев
+ #используется при создании
+ #по умолчанию - true
+ #enable_default_gateway = false
}
output "test" {
diff --git a/samples/cloudbroker/account/data_account_audits_list/main.tf b/samples/cloudbroker/account/data_account_audits_list/main.tf
index 88c7ba83..0604c53b 100644
--- a/samples/cloudbroker/account/data_account_audits_list/main.tf
+++ b/samples/cloudbroker/account/data_account_audits_list/main.tf
@@ -1,6 +1,6 @@
/*Deprecated
-Данный datasource является **deprecated** и будет удалён в следующих версиях. Вместо него неоходимо использовать datasource **decort_cb_audit_list**.
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**. Вместо него неоходимо использовать datasource **decort_cb_audit_list**.
*/
/*
diff --git a/samples/cloudbroker/disk/resource_disk/main.tf b/samples/cloudbroker/disk/resource_disk/main.tf
index 491bb8eb..b7f36e2b 100644
--- a/samples/cloudbroker/disk/resource_disk/main.tf
+++ b/samples/cloudbroker/disk/resource_disk/main.tf
@@ -134,10 +134,11 @@ resource "decort_cb_disk" "my_disk01" {
#включение режима unmap для диска
#опциональный параметр
- #тип - булев
- #по умолчанию - false
+ #тип - строка
+ #по умолчанию - "ignore"
+ #возможные варианты: "ignore" или "unmap"
#используется при создании и обновлении
- #blk_discard = false
+ #discard = "unmap"
#размер блока диска
#опциональный параметр
diff --git a/samples/cloudbroker/grid/data_grid_list_emails/main.tf b/samples/cloudbroker/grid/data_grid_list_emails/main.tf
index 137d40b4..2ab0870d 100644
--- a/samples/cloudbroker/grid/data_grid_list_emails/main.tf
+++ b/samples/cloudbroker/grid/data_grid_list_emails/main.tf
@@ -1,3 +1,8 @@
+/*Deprecated
+
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**.
+*/
+
/*
Пример использования
Получение списка email-адресов пользователей.
diff --git a/samples/cloudbroker/image/data_image_list/main.tf b/samples/cloudbroker/image/data_image_list/main.tf
index 4112178d..f6f345cf 100644
--- a/samples/cloudbroker/image/data_image_list/main.tf
+++ b/samples/cloudbroker/image/data_image_list/main.tf
@@ -54,8 +54,8 @@ data "decort_cb_image_list" "il" {
#фильтр по типу образа
#опциональный параметр
- #тип - строка
- #type_image = "cdrom"
+ #тип - массив строк
+ #type_image = ["linux", "windows"]
#фильтр по размеру образа
#опциональный параметр
diff --git a/samples/cloudbroker/k8s/resource_k8s_cp/main.tf b/samples/cloudbroker/k8s/resource_k8s_cp/main.tf
index 4249f4b6..c1e5ed39 100644
--- a/samples/cloudbroker/k8s/resource_k8s_cp/main.tf
+++ b/samples/cloudbroker/k8s/resource_k8s_cp/main.tf
@@ -42,6 +42,7 @@ resource "decort_cb_k8s_cp" "cp" {
#обязательный параметр
#тип - целое число
#используется при создании
+ #максимально поддерживаемая версия Kubernetes < 1.29
k8sci_id = 55
#плагин сети
diff --git a/samples/cloudbroker/kvmvm/data_kvmvm_audits/main.tf b/samples/cloudbroker/kvmvm/data_kvmvm_audits/main.tf
index 04e01861..8ec98223 100644
--- a/samples/cloudbroker/kvmvm/data_kvmvm_audits/main.tf
+++ b/samples/cloudbroker/kvmvm/data_kvmvm_audits/main.tf
@@ -1,6 +1,6 @@
/*Deprecated
-Данный datasource является **deprecated** и будет удалён в следующих версиях. Вместо него неоходимо использовать datasource **decort_cb_audit_list**.
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**. Вместо него неоходимо использовать datasource **decort_cb_audit_list**.
*/
/*
diff --git a/samples/cloudbroker/kvmvm/data_kvmvm_cpu_alignment_profile/main.tf b/samples/cloudbroker/kvmvm/data_kvmvm_cpu_alignment_profile/main.tf
new file mode 100644
index 00000000..2aa6f44f
--- /dev/null
+++ b/samples/cloudbroker/kvmvm/data_kvmvm_cpu_alignment_profile/main.tf
@@ -0,0 +1,38 @@
+/*
+Пример использования
+Получение данных о профиле CPU alignment виртуальной машины
+*/
+
+#Раскомментируйте этот код,
+#и внесите необходимые правки в версию и путь,
+#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
+/*
+terraform {
+ required_providers {
+ decort = {
+ source = "basis/decort/decort"
+ version = ""
+ }
+ }
+}
+*/
+
+provider "decort" {
+ authenticator = "decs3o"
+ #controller_url =
+ controller_url = "https://ds1.digitalenergy.online"
+ #oauth2_url =
+ oauth2_url = "https://sso.digitalenergy.online"
+ allow_unverified_ssl = true
+}
+
+data "decort_cb_kvmvm_cpu_alignment_profile" "cpu_alignment_profile" {
+ #id виртуальной машины
+ #обязательный параметр
+ #тип - целое число
+ compute_id = 100
+}
+
+output "output" {
+ value = data.decort_cb_kvmvm_cpu_alignment_profile.cpu_alignment_profile
+}
diff --git a/samples/cloudbroker/kvmvm/data_kvmvm_get_audits/main.tf b/samples/cloudbroker/kvmvm/data_kvmvm_get_audits/main.tf
index 1a582685..3afa1c47 100644
--- a/samples/cloudbroker/kvmvm/data_kvmvm_get_audits/main.tf
+++ b/samples/cloudbroker/kvmvm/data_kvmvm_get_audits/main.tf
@@ -1,3 +1,8 @@
+/*Deprecated
+
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**. Вместо него неоходимо использовать datasource **decort_cb_audit_list**.
+*/
+
/*
Пример использования
Получение данных об аудитах compute (виртулаьной машины)
diff --git a/samples/cloudbroker/kvmvm/data_kvmvm_get_log/main.tf b/samples/cloudbroker/kvmvm/data_kvmvm_get_log/main.tf
index 0d464338..8068ad5d 100644
--- a/samples/cloudbroker/kvmvm/data_kvmvm_get_log/main.tf
+++ b/samples/cloudbroker/kvmvm/data_kvmvm_get_log/main.tf
@@ -1,3 +1,8 @@
+/*Deprecated
+
+Данный datasource является **deprecated** и будет удалён в версии **4.14.0**.
+*/
+
/*
Пример использования
Получение логов compute (виртуальной машины)
diff --git a/samples/cloudbroker/kvmvm/resource_kvmvm/main.tf b/samples/cloudbroker/kvmvm/resource_kvmvm/main.tf
index c5ef1d8d..31542659 100644
--- a/samples/cloudbroker/kvmvm/resource_kvmvm/main.tf
+++ b/samples/cloudbroker/kvmvm/resource_kvmvm/main.tf
@@ -69,6 +69,13 @@ resource "decort_cb_kvmvm" "comp" {
#используется при создании и обновлении
#chipset = "Q35"
+ #тип часов для ВМ
+ #опциональный параметр
+ #возможные значения: "default", "linux", "windows", "none"
+ #по умолчанию - "default"
+ #используется при создании и обновлении
+ #clock = "linux"
+
#id образа диска для создания compute
#опциональный параметр
#тип - целое число
@@ -197,7 +204,6 @@ resource "decort_cb_kvmvm" "comp" {
#возможные варианты: "none" или "writethrough"
#cache = "none"
-
#опциональный параметр
#тип - целое число
#sep_id = 1
@@ -226,11 +232,20 @@ resource "decort_cb_kvmvm" "comp" {
#тип - булев
#permanently = false
- #включение режима unmap для диска
+ #монтирование диска в режиме read only
+ #используется только при добавлении нового диска к существующей ВМ
#опциональный параметр
#тип - булев
#по умолчанию - false
- #blk_discard = false
+ #read_only = true
+
+ #включение режима unmap для диска
+ #опциональный параметр
+ #тип - строка
+ #по умолчанию - "ignore"
+ #возможные варианты: "ignore" или "unmap"
+ #используется при создании и обновлении
+ #discard = "unmap"
#размер блока диска
#опциональный параметр
@@ -336,6 +351,12 @@ resource "decort_cb_kvmvm" "comp" {
#используется при создании и обновлении
#affinity_label = "test4"
+ #имя профиля CPU alignment
+ #опциональный параметр
+ #тип - строка
+ #используется при создании и обновлении
+ #cpu_alignment_profile = "balanced"
+
#id экстра дисков
#опциональный параметр
#тип - список чисел
@@ -402,11 +423,18 @@ resource "decort_cb_kvmvm" "comp" {
#тип - булев
#enabled = true
+ #выключение шлюза по умолчанию на интерфейсе
+ #используется только с сетями типа "VINS"
+ #по умолчанию - true
+ #опциональный параметр
+ #тип - булев
+ #enable_default_gateway = false
+
#маска подсети
#используется только с сетями типа "DPDK" и "VFNIC"
#опциональный параметр
#тип - целое число
- #net_mask = 32
+ #net_mask = 32
#}
#группы безопасности
@@ -724,10 +752,11 @@ resource "decort_cb_kvmvm" "comp" {
#включение режима unmap для boot диска
#опциональный параметр
- #тип - булев
- #по умолчанию - false
+ #тип - строка
+ #по умолчанию - "ignore"
#используется при создании и обновлении
- #boot_disk_blk_discard = false
+ #возможные варианты: "ignore" или "unmap"
+ #boot_disk_discard = "unmap"
}
output "test" {
diff --git a/samples/cloudbroker/node/data_node_network_info/main.tf b/samples/cloudbroker/node/data_node_network_info/main.tf
new file mode 100644
index 00000000..f81d4c9a
--- /dev/null
+++ b/samples/cloudbroker/node/data_node_network_info/main.tf
@@ -0,0 +1,38 @@
+/*
+Пример использования
+Получение сетевой информации ноды
+*/
+
+#Раскомментируйте этот код,
+#и внесите необходимые правки в версию и путь,
+#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
+/*
+terraform {
+ required_providers {
+ decort = {
+ source = "basis/decort/decort"
+ version = ""
+ }
+ }
+}
+*/
+
+provider "decort" {
+ authenticator = "decs3o"
+ #controller_url =
+ controller_url = "https://ds1.digitalenergy.online"
+ #oauth2_url =
+ oauth2_url = "https://sso.digitalenergy.online"
+ allow_unverified_ssl = true
+}
+
+data "decort_cb_node_network_info" "network_info" {
+ #id ноды
+ #обязательный параметр
+ #тип - целое число
+ node_id = 100
+}
+
+output "output" {
+ value = data.decort_cb_node_network_info.network_info
+}
diff --git a/samples/cloudbroker/node/data_node_pci_devices/main.tf b/samples/cloudbroker/node/data_node_pci_devices/main.tf
new file mode 100644
index 00000000..710afd46
--- /dev/null
+++ b/samples/cloudbroker/node/data_node_pci_devices/main.tf
@@ -0,0 +1,58 @@
+/*
+Пример использования
+Получение списка PCI-устройств ноды
+*/
+
+#Раскомментируйте этот код,
+#и внесите необходимые правки в версию и путь,
+#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
+/*
+terraform {
+ required_providers {
+ decort = {
+ source = "basis/decort/decort"
+ version = ""
+ }
+ }
+}
+*/
+
+provider "decort" {
+ authenticator = "decs3o"
+ #controller_url =
+ controller_url = "https://ds1.digitalenergy.online"
+ #oauth2_url =
+ oauth2_url = "https://sso.digitalenergy.online"
+ allow_unverified_ssl = true
+}
+
+data "decort_cb_node_pci_devices" "pci_devices" {
+ #id ноды
+ #обязательный параметр
+ #тип - целое число
+ node_id = 100
+
+ #строка поиска
+ #опциональный параметр
+ #тип - строка
+ #search = "nvidia"
+
+ #сортировка по полю, формат +|-(поле)
+ #опциональный параметр
+ #тип - строка
+ #sort_by = "+product_name"
+
+ #номер страницы
+ #опциональный параметр
+ #тип - целое число
+ #page = 1
+
+ #размер страницы
+ #опциональный параметр
+ #тип - целое число
+ #size = 10
+}
+
+output "output" {
+ value = data.decort_cb_node_pci_devices.pci_devices
+}
diff --git a/samples/cloudbroker/rg/resource_rg/main.tf b/samples/cloudbroker/rg/resource_rg/main.tf
index 3848d083..6df7b674 100644
--- a/samples/cloudbroker/rg/resource_rg/main.tf
+++ b/samples/cloudbroker/rg/resource_rg/main.tf
@@ -221,6 +221,12 @@ resource "decort_cb_rg" "rg" {
#значение по умолчанию - -1
#limit = 111
#}
+
+ #включение шлюза по умолчанию
+ #опциональный параметр
+ #тип - булев
+ #используется при создании
+ #enable_default_gateway = false
}
output "output" {
diff --git a/samples/cloudbroker/sep/data_sep_consumption/main.tf b/samples/cloudbroker/sep/data_sep_consumption/main.tf
index 9279bf50..88726e9a 100644
--- a/samples/cloudbroker/sep/data_sep_consumption/main.tf
+++ b/samples/cloudbroker/sep/data_sep_consumption/main.tf
@@ -28,9 +28,9 @@ provider "decort" {
data "decort_cb_sep_consumption" "scons" {
#id sep
- #обязательный параметр
+ #опциональный параметр
#тип - целое число
- sep_id = 1111
+ #sep_id = 1111
}
output "test" {
diff --git a/samples/cloudbroker/user/resource_user/main.tf b/samples/cloudbroker/user/resource_user/main.tf
index 039810d5..a7a0afaa 100644
--- a/samples/cloudbroker/user/resource_user/main.tf
+++ b/samples/cloudbroker/user/resource_user/main.tf
@@ -44,11 +44,10 @@ resource "decort_cb_user" "user" {
emailaddress = "user1@example.com"
#пароль пользователя
- #значение по умолчанию – strongpassword
- #опциональный параметр
+ #обязательный параметр
#тип - строка
#используется при создании
- #password = "user1Password"
+ password = "user1Password"
#список групп доступа к api, к которым принадлежит этот пользователь
#опциональный параметр
diff --git a/samples/cloudbroker/vins/resource_vins/main.tf b/samples/cloudbroker/vins/resource_vins/main.tf
index 5240334f..de9bff43 100644
--- a/samples/cloudbroker/vins/resource_vins/main.tf
+++ b/samples/cloudbroker/vins/resource_vins/main.tf
@@ -8,7 +8,7 @@
4. Добавлять и убирать подключение к внешней сети
5. Резервировать и освобождать ip для vins
6. Добавлять и удалять natrule
-7. Перезапускать и редеплоить vnfdev
+7. Запускать, останавливать, перезапускать и редеплоить vnfdev
*/
#Раскомментируйте этот код,
@@ -213,7 +213,7 @@ resource "decort_cb_vins" "vins" {
#опциональный параметр
#true: старт vnfDev; false: стоп vnfDev
#тип - булев
- #используется при обновлении
+ #используется при создании и обновлении
#vnfdev_start = true
#перезапуск vnfDev
@@ -255,6 +255,12 @@ resource "decort_cb_vins" "vins" {
#значение по умолчанию - false
#enable_secgroups = false
+ #включение шлюза по умолчанию
+ #опциональный параметр
+ #тип - булев
+ #используется при создании и обновлении
+ #по умолчанию - true
+ #enable_default_gateway = false
}
output "test" {
diff --git a/samples/cloudbroker/zone/data_zone_cpu_alignment_profile/main.tf b/samples/cloudbroker/zone/data_zone_cpu_alignment_profile/main.tf
new file mode 100644
index 00000000..52918c7c
--- /dev/null
+++ b/samples/cloudbroker/zone/data_zone_cpu_alignment_profile/main.tf
@@ -0,0 +1,38 @@
+/*
+Пример использования
+Получение профиля выравнивания CPU зоны по её id
+*/
+
+#Расскомментируйте этот код,
+#и внесите необходимые правки в версию и путь,
+#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
+/*
+terraform {
+ required_providers {
+ decort = {
+ source = "basis/decort/decort"
+ version = ""
+ }
+ }
+}
+*/
+
+provider "decort" {
+ authenticator = "decs3o"
+ #controller_url =
+ controller_url = "https://ds1.digitalenergy.online"
+ #oauth2_url =
+ oauth2_url = "https://sso.digitalenergy.online"
+ allow_unverified_ssl = true
+}
+
+data "decort_cb_zone_cpu_alignment_profile" "cap" {
+ #идентификатор зоны
+ #обязательный параметр
+ #тип - целое число
+ zone_id = 1
+}
+
+output "test" {
+ value = data.decort_cb_zone_cpu_alignment_profile.cap
+}
diff --git a/samples/cloudbroker/zone/data_zone_cpu_alignment_profile_list/main.tf b/samples/cloudbroker/zone/data_zone_cpu_alignment_profile_list/main.tf
new file mode 100644
index 00000000..82a08ddf
--- /dev/null
+++ b/samples/cloudbroker/zone/data_zone_cpu_alignment_profile_list/main.tf
@@ -0,0 +1,38 @@
+/*
+Пример использования
+Получение списка профилей выравнивания CPU зон
+*/
+
+#Расскомментируйте этот код,
+#и внесите необходимые правки в версию и путь,
+#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
+/*
+terraform {
+ required_providers {
+ decort = {
+ source = "basis/decort/decort"
+ version = ""
+ }
+ }
+}
+*/
+
+provider "decort" {
+ authenticator = "decs3o"
+ #controller_url =
+ controller_url = "https://ds1.digitalenergy.online"
+ #oauth2_url =
+ oauth2_url = "https://sso.digitalenergy.online"
+ allow_unverified_ssl = true
+}
+
+data "decort_cb_zone_cpu_alignment_profile_list" "cap_list" {
+ #фильтрация по идентификатору зоны
+ #опциональный параметр
+ #тип - целое число
+ #zone_id = 1
+}
+
+output "test" {
+ value = data.decort_cb_zone_cpu_alignment_profile_list.cap_list
+}
diff --git a/samples/cloudbroker/zone/data_zone_cpu_alignment_profile_test/main.tf b/samples/cloudbroker/zone/data_zone_cpu_alignment_profile_test/main.tf
new file mode 100644
index 00000000..8de34e23
--- /dev/null
+++ b/samples/cloudbroker/zone/data_zone_cpu_alignment_profile_test/main.tf
@@ -0,0 +1,43 @@
+/*
+Пример использования
+Тестирование профиля выравнивания CPU зоны
+*/
+
+#Расскомментируйте этот код,
+#и внесите необходимые правки в версию и путь,
+#чтобы работать с установленным вручную (не через hashicorp provider registry) провайдером
+/*
+terraform {
+ required_providers {
+ decort = {
+ source = "basis/decort/decort"
+ version = ""
+ }
+ }
+}
+*/
+
+provider "decort" {
+ authenticator = "decs3o"
+ #controller_url =
+ controller_url = "https://ds1.digitalenergy.online"
+ #oauth2_url =
+ oauth2_url = "https://sso.digitalenergy.online"
+ allow_unverified_ssl = true
+}
+
+data "decort_cb_zone_cpu_alignment_profile_test" "cap_test" {
+ #идентификатор зоны
+ #обязательный параметр
+ #тип - целое число
+ zone_id = 1
+
+ #схожесть гипервизоров в процентах
+ #опциональный параметр
+ #тип - целое число
+ #hypervisor_similarity_in_percentage = 70
+}
+
+output "test" {
+ value = data.decort_cb_zone_cpu_alignment_profile_test.cap_test
+}
diff --git a/samples/cloudbroker/zone/resource_zone/main.tf b/samples/cloudbroker/zone/resource_zone/main.tf
index 2ec44467..d23aa5d3 100644
--- a/samples/cloudbroker/zone/resource_zone/main.tf
+++ b/samples/cloudbroker/zone/resource_zone/main.tf
@@ -63,6 +63,24 @@ resource "decort_cb_zone" "zone" {
#значение по умолчанию - false
#используется при создании
#drs = false
+
+ #профиль выравнивания CPU
+ #опциональный параметр
+ #тип - целое число
+ #используется при создании и обновлении
+ #hypervisor_similarity_in_percentage = 70
+
+ #количество зарезервированных ядер CPU
+ #опциональный параметр, используется вместе с reserved_ram
+ #тип - целое число
+ #используется при создании и обновлении
+ #reserved_cpu = 4
+
+ #количество зарезервированной RAM (МБ)
+ #опциональный параметр, используется вместе с reserved_cpu
+ #тип - целое число
+ #используется при создании и обновлении
+ #reserved_ram = 4096
}
output "test" {
diff --git a/samples/sdn/logicalports/resource_logical_port/main.tf b/samples/sdn/logicalports/resource_logical_port/main.tf
index 12732bce..0eb39c49 100644
--- a/samples/sdn/logicalports/resource_logical_port/main.tf
+++ b/samples/sdn/logicalports/resource_logical_port/main.tf
@@ -143,14 +143,14 @@ resource "decort_sdn_logical_port" "test" {
#опциональный параметр
#тип - булев
#значение по умолчанию - false
- #используется только при обновлении
+ #используется при обновлении
#migrate = true
#флаг принудительного удаления
#опциональный параметр
#тип - булев
#значение по умолчанию - false
- #используется только при удалении
+ #используется при обновлении
#force = true
}
diff --git a/samples/sdn/netobjgroups/data_decort_sdn_network_object_group_list/main.tf b/samples/sdn/netobjgroups/data_decort_sdn_network_object_group_list/main.tf
index da8f2539..0405c6db 100644
--- a/samples/sdn/netobjgroups/data_decort_sdn_network_object_group_list/main.tf
+++ b/samples/sdn/netobjgroups/data_decort_sdn_network_object_group_list/main.tf
@@ -81,6 +81,12 @@ data "decort_sdn_network_object_group_list" "name" {
#тип - строка
#значение по умолчанию - null
#updated_to = "2025-01-01T00:00:00Z"
+
+ #фильтр по типу
+ #опциональный параметр
+ #тип - строка
+ #возможные значения - User, System
+ #type = "User"
}
output "test" {