配置基于插件的实例资源

作为云管理员,您可以在构建基础架构时利用 Google Cloud Platform (GCP) 插件置备基于插件的实例资源。此外,还可以使用分配帮助程序为实例提供分配逻辑。
可以使用最新的 GCP 属性轻松配置实例以支持您的基础架构需求。例如,如果要避免在更新期间实例中断,可以在置备期间在云模板中使用
most_disruptive_allowed_action
属性。
部署实例后,可以通过运行实施后操作管理资源,例如将其他磁盘附加到资源。
To learn more about plug-ins and allocation in
VMware Aria Automation
, see Plug-in based designs and deployments in Automation Assembler

实例属性

基于插件的实例资源需要以下属性。
有关实例属性的完整列表,请参见 Google Cloud REST 文档。GCP 文档中的资源属性以驼峰形式编写,而
Automation Assembler
中的资源属性以蛇形形式编写。
name
实例的名称。
有关命名要求,请参见 Google Cloud 文档中的命名约定
zone
将部署实例的区域。
有关详细信息,请参见 Google Cloud 文档中的地区和区域
account
您的团队在其中部署云模板的帐户区域的 GCP 云帐户。
以下部分包含用于在
Automation Assembler
中置备基于插件的实例的示例云模板。

置备具有单独磁盘资源的受防护实例

以下模板展示了如何使用分配帮助程序置备受防护实例。在此示例中,将创建一个磁盘并将其附加到受防护实例资源。
在部署此模板之前,请完成以下步骤:
  1. Automation Assembler
    中创建 GCP 云帐户,创建项目,然后添加云区域。
    在此示例中,云区域为 europe-central2。
  2. 为项目设置映像映射。
    所选映像必须支持受防护实例功能。
  3. 为项目设置特定实例映射。
    在此示例中,特定实例
    n1
    映射到 n1-standard-1 GCP 计算机类型。
  4. 在同一云区域中设置具有标记
    default
    的网络配置文件,以映射到默认 GCP 网络。
  5. 如果使用加密密钥,则必须在部署蓝图之前创建密钥环和密钥。此示例模板使用全局密钥环。密钥 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