Try to deploy the VM to custom VPC network called “MyNet” using deployment manager, just don’t know how to put my custom VPC network in the yaml file, also want to use SSD instead of standard PERSISTENT disk as well.
resources:
- name: vm
type: compute.v1.instance
properties:
zone: northamerica-northeast1-a
machineType: zones/northamerica-northeast1-a/machineTypes/f1-micro
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: projects/centos-cloud/global/images/family/centos-7
networkInterfaces:
- network: global/networks/default
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
2
Answers
You can take a look at this example explaining how to create two VMs and a custom network with Google Deployment Manager. In this repository, you can also find other examples that might be useful.
Anyway, for your specific problem : to create a custom VPC network, use :
Check the REST reference of network resource to find all possible parameters.
To reference your custom network and also to use SSD instead of Standard disk for your VM :
networkInterfaces
section (network: $(ref.my-custom-network.selfLink)
)disks.initializeParams.diskType
property in your VM configurationTo conclude, for your VM, you should write :
For the disk, notice the
pd-ssd
at the end of thedisks[0].initializeParams.diskType
property, instead ofpd-standard
(default). Check the REST reference of instance resource for other parameters.You just need to specify a
subnetwork
of custom VPC, That sit