Creating a GCE instance from a snapshot

I’m trying to figure out how to create a GCE image with a persistent boot disk from a snapshot. At the API level, this is just: a POST to /disks with snapshotSource set, and a POST to /instances with a reference to the new disk. It looks like libcloud supports this (i.e., create_volume() takes a snapshot and create_node() takes an existing disk). But gce_pd explicitly says it “does not support creating boot disks from images or snapshots” and, as far as I can tell, there’s no way to give a snapshot or a named disk to the gce module.

Is this by design? It seems like the easiest way to support this would be to add a snapshot option to gce_pd. I could do this if you think that would work.

Regards,
Chris

I’m open to it.

Not sure he’s on the list but might want to keep Eric Johnson in the loop on module things.

[cc: Eric]

BTW, we have some (start) of some cloud tests at tests/integration for some of the other providers.

I’m more than happy to take additions – the idea here is to use credentials the user provides (not checked in) to deploy some cloud workloads and use the assert modules to make sure they work.

I just sent a PR:
https://github.com/ansible/ansible/pull/6976