身為雲端管理員,您可以在建置基礎結構時利用 Google Cloud Platform (GCP) 外掛程式佈建以外掛程式為基礎的執行個體資源。此外,還可以使用配置協助程式為執行個體提供配置邏輯。
可以使用最新的 GCP 內容輕鬆設定執行個體以支援您的基礎結構需求。例如,如果要避免更新期間執行個體出現中斷,可以在佈建期間在雲端範本中使用 most_disruptive_allowed_action 內容。
部署執行個體後,可以執行第 2 天動作以管理資源,例如將其他磁碟連結到資源。
若要進一步瞭解 VMware Aria Automation 中的外掛程式和配置,請參閱〈Automation Assembler 中以外掛程式為基礎的設計和部署〉
執行個體內容
以外掛程式為基礎的執行個體資源需要以下內容。
如需有關執行個體內容的完整清單,請參閱 Google Cloud REST 說明文件。GCP 說明文件中的資源內容以駝峰形式撰寫,而 Automation Assembler 中的資源內容以 snake case (蛇形命名法) 撰寫。
name |
執行個體的名稱。 如需命名需求,請參閱 Google Cloud 說明文件中的命名慣例。 |
zone |
將部署執行個體的區域。 如需詳細資訊,請參閱 Google Cloud 說明文件中的地區和區域。 |
account |
您的團隊在其中部署雲端範本的帳戶區域的 GCP 雲端帳戶。 如需詳細資訊,請參閱〈在 VMware Aria Automation 中建立 Google Cloud Platform 雲端帳戶〉。 |
以下部分包含用於在 Automation Assembler 中佈建以外掛程式為基礎的執行個體的範例雲端範本。
佈建具有單獨磁碟資源的受防護執行個體
以下範本顯示了如何使用配置協助程式佈建受防護執行個體。在此範例中,將建立一個磁碟並將其連結到受防護執行個體資源。
- 在 Automation Assembler 中建立 GCP 雲端帳戶,建立專案,然後新增雲端區域。
在此範例中,雲端區域為 europe-central2。
- 為專案設定映像對應。
所選映像必須支援受防護執行個體功能。
- 為專案設定類型模板對應。
在此範例中,類型模板
n1對應到 n1-standard-1 GCP 機器類型。 - 在同一雲端區域中設定具有標籤
default的網路設定檔,以對應到預設 GCP 網路。 - 如果使用加密金鑰,則必須在部署藍圖之前建立金鑰環和金鑰。此範例範本使用全域金鑰環。金鑰識別碼將作為輸入傳遞到範本。如需詳細資訊,請參閱 GCP Cloud Key Management Service 說明文件。
formatVersion: 1
inputs:
name:
type: string
title: VM name
kms_key_name:
type: string
title: Full key name
description: 'Example format for a global key ring: projects/<project>/locations/global/keyRings/<ring>/cryptoKeys/<key>'
resources:
Allocations_Compute_1:
type: Allocations.Compute
properties: {}
Allocations_Network_1:
type: Allocations.Network
properties:
networkType: existing
constraints:
- tag: default
Allocations_Flavor_1:
type: Allocations.Flavor
properties:
flavor: n1
Allocations_Image_1:
type: Allocations.Image
properties:
image: centos-7-shielded
BOOT_DISK:
type: Idem.GCP.COMPUTE.DISK
properties:
name: idem-disk-${input.name}-boot
account: ${resource.Allocations_Compute_1.selectedCloudAccount.name}
zone: ${resource.Allocations_Compute_1.selectedPlacementCompute.id}
type_: ${'projects/' + resource.Allocations_Compute_1.selectedCloudAccount.additionalProperties.gcp.project + '/zones/' + resource.Allocations_Compute_1.selectedPlacementCompute.id + '/diskTypes/pd-balanced'}
size_gb: 20
source_image: ${resource.Allocations_Image_1.selectedImageId}
disk_encryption_key:
kms_key_name: ${input.kms_key_name}
Idem_GCP_COMPUTE_INSTANCE_1:
type: Idem.GCP.COMPUTE.INSTANCE
properties:
name: ${input.name}
zone: ${resource.Allocations_Compute_1.selectedPlacementCompute.id}
account: ${resource.Allocations_Compute_1.selectedCloudAccount.name}
can_ip_forward: false
machine_type: ${'projects/' + resource.Allocations_Compute_1.selectedCloudAccount.additionalProperties.gcp.project + '/zones/' + resource.Allocations_Compute_1.selectedPlacementCompute.id + '/machineTypes/' + resource.Allocations_Flavor_1.selectedInstanceTypeName }
shielded_instance_config:
enable_integrity_monitoring: true
enable_secure_boot: true
enable_vtpm: true
network_interfaces:
- access_configs:
- kind: compute#accessConfig
name: External NAT
network_tier: PREMIUM
set_public_ptr: false
type_: ONE_TO_ONE_NAT
kind: compute#networkInterface
name: nic0
stack_type: IPV4_ONLY
subnetwork: ${'projects/' + resource.Allocations_Compute_1.selectedCloudAccount.additionalProperties.gcp.project + '/regions/' + resource.Allocations_Compute_1.selectedRegion.id + '/subnetworks/' + resource.Allocations_Network_1.selectedSubnet.name }
disks:
- auto_delete: false
boot: true
device_name: ${resource.BOOT_DISK.name}
source: ${resource.BOOT_DISK.resource_id}
mode: READ_WRITE
type_: PERSISTENT
- auto_delete: false
boot: false
device_name: idem-disk-${input.name}-additional
initialize_params:
disk_size_gb: 15
disk_type: ${'projects/' + resource.Allocations_Compute_1.selectedCloudAccount.additionalProperties.gcp.project + '/zones/' + resource.Allocations_Compute_1.selectedPlacementCompute.id + '/diskTypes/pd-balanced'}
disk_encryption_key:
kms_key_name: ${input.kms_key_name}
mode: READ_WRITE
type_: PERSISTENT
scheduling:
automatic_restart: true
on_host_maintenance: MIGRATE
preemptible: false
provisioning_model: STANDARD
deletion_protection: false