I've created a few instances in google compute engine by using the web interface. I want to start doing it at the command line instead so that I can create more and automate the process. The web interface tells me what command I could use when creating an instance. I request a permanent public IP address, and I can see the command which works, but how do I know what addresses are available to request? For instance, let's stay I created serverA with the command "gcloud compute … instances create "serverA" .. –address 1.2.3.4 …" I reused an address I had been previously assigned, but I think I got lucky in that it worked, and I can't guess what other IP addresses to use when I want to create more instances on the command line. Is there a way to query for available addresses? Thank you.
Tom
Best Answer
UPDATE
A second approach to do this is by using the deployment manager. You can have a configuration file where you create the IP resource. In the same file you specify to deploy the VM with that IP assigned.
i.e. running
gcloud deployment-manager deployments create testdeploy --config=myconf.yaml
where myconf.yaml file content is