简体   繁体   中英

How to automate creating 1500 Google Cloud VM Instances?

I need to create 1500 GCP VM instances all with the same configurations. How can I automate this process? With python or any easy way?

Yes, you can use Python for that. More specifically, you would be using GCP's Deployment Manager and specifying the desired configuration in the file written with Python.

The configuration can be specified in either .yaml , .jinja or .py formatted files - Google recommends using Python for complex deployments such as these. You can find a sample deployment of multiple Compute Engine instances here . Edit the configuration file according to your project and your needs and you should be good to go.

There are other ways of achieving it like creating an Instance Template and the scripting a gcloud CLI command to create instances from it, but that is assuming the configuration is indeed the same for all the instances and it can also become rather cumbersome to maintain, especially when Google already provides you with Deployment Manager and its features.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM