Reputation: 1546
I am using nodejs client library, and I am stuck in a situation. I need to create disposable VM on demand, which means those instances would be up for a couple of days and then would be deleted. All of this would happen via an API.
The default size of the disk while creating a VM is 10GB, and I need a larger disk than that.
Is it possible to do that, without creating a disk first and then attaching it to my VM? As that would be a hassle since I'd have to make sure that I'd delete the disk too, whenever I'd delete the instance.
Upvotes: 1
Views: 207
Reputation: 4441
You can use the compute.instances.insert
API method to create a Compute Engine instance, and set its disks[].initializeParams.diskSizeGb
parameter specifying the desired disk size. You can find more information regarding this API call here.
Upvotes: 3