Jelajahi Sumber

GCP: Refactor data disk(s) creation and setup to instance template v2 (#537)

* Add roles to create and delete empty image (workaround)

GCE API does not allow you to specify empty disks in instance templates.  This is a workaround to that limitation.  The version of cloudilb currently available as an RPM on my build system also doesn’t allow me to specify a family for this image.  The impact of this is limited because GCE API has a bug where as if we specify the image using the family it doesn’t work as expected.

* Refactor disk creation to instance templates

There is currently a bug in GCE API that when you specify a non-boot disk sourceImage as a family it will instead use the sourceImage from the boot disk.  To workaround this we don’t use a family to specify this sourceImage even though it is more appropriate to do so.

* Instance group related pauses

We introduce two pauses:

1) Immediately after creating the “core” deployment.  This is to give time to the instance groups to become “complete”.  Ideally we would poll the API instead of waiting a fixed amount of time but this is better than nothing.

2) The second waits for the newly spawned instances to be reachable.  Ideally we would use wait_for_connection to achieve this but the following bug keeps this from working for instances behind a bastion host: https://github.com/ansible/ansible/issues/23774

* Use cloud-init to configure attached data disks

* Cosmetics cleanup, removed some values which are default..

Also let's forget about empty image family, no need to version this image.

* Query instance group manager to see if instances are ready

* Empty image archive is very small, no need for composite upload

* Use more robust check if instances are ready for ssh
Peter Schiffer 7 tahun lalu
induk
melakukan
316fe94d1d

Data Diff Tidak Tersedia.