クラウド管理者は、Google Cloud Platform (GCP) プラグインを利用して、インフラストラクチャの構築時にプラグイン ベースのインスタンス リソースをプロビジョニングできます。割り当てヘルパーを使用して、インスタンスの割り当てロジックを提供することもできます。
最新の GCP プロパティを使用して、インフラストラクチャのニーズをサポートするようにインスタンスを簡単に構成できます。たとえば、更新中にインスタンスの中断を回避する場合は、プロビジョニング中にクラウド テンプレートの most_disruptive_allowed_action プロパティを使用します。
インスタンスを展開したら、リソースに追加のディスクを接続するなどの Day 2 アクションを実行して、リソースを管理できます。
VMware Aria Automation でのプラグインと割り当ての詳細については、「Automation Assembler のプラグイン ベースのデザインと展開」を参照してください。
インスタンスのプロパティ
プラグイン ベースのインスタンス リソースには、次のプロパティが必要です。
インスタンス プロパティの完全なリストについては、「Google Cloud REST のドキュメント」を参照してください。GCP ドキュメントのリソース プロパティはキャメルケースで記述されており、Automation Assembler のリソース プロパティはスネークケースで記述されています。
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 ネットワークにマッピングします。 - 暗号化キーを使用している場合は、ブループリントを展開する前にキー リングとキーを作成する必要があります。このテンプレートの例では、グローバル キー リングを使用します。キー ID は、テンプレートに入力として渡されます。詳細については、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