【发布时间】:2023-04-01 23:23:01
【问题描述】:
如何创建可在实例中创建空磁盘的实例模板?创建实例模板时,磁盘似乎需要源属性。
- name: {{ TEMPLATE_NAME }}
type: compute.v1.instanceTemplate
properties:
properties:
machineType: {{ properties["machine_type"] }}
canIpForward: False
networkInterfaces:
- network: "projects/mapreng-1/global/networks/{{ VPC }}"
#No internet access if this is not specified
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/{{ PROJECT }}/global/images/{{ IMAGE }}
- deviceName: dev1
type: SCRATCH
autoDelete: true
initializeParams:
diskType: pd-ssd
diskSizeGb: 20
这在运行时失败,“必须指定源图像”
【问题讨论】: