# Creating a GCE instance from a snapshot

**URL:** <https://forum.ansible.com/t/creating-a-gce-instance-from-a-snapshot/14871>\
**Category:** Ansible Developer\
**Created:** [March 27, 2014, 5:11pm UTC](https://forum.ansible.com/t/creating-a-gce-instance-from-a-snapshot/14871 "2014-03-27T17:11:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Conway](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@Chris\_Conway](https://forum.ansible.com/u/Chris_Conway)\
**Post date:** [March 27, 2014, 5:11pm UTC](https://forum.ansible.com/t/creating-a-gce-instance-from-a-snapshot/14871/1 "2014-03-27T17:11:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 27, 2014, 8:23pm UTC](https://forum.ansible.com/t/creating-a-gce-instance-from-a-snapshot/14871/2 "2014-03-27T20:23:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_Conway](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@Chris\_Conway](https://forum.ansible.com/u/Chris_Conway)\
**Post date:** [March 27, 2014, 8:31pm UTC](https://forum.ansible.com/t/creating-a-gce-instance-from-a-snapshot/14871/3 "2014-03-27T20:31:43Z")

</div>

[cc: Eric]

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [March 27, 2014, 10:49pm UTC](https://forum.ansible.com/t/creating-a-gce-instance-from-a-snapshot/14871/4 "2014-03-27T22:49:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_Conway](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@Chris\_Conway](https://forum.ansible.com/u/Chris_Conway)\
**Post date:** [April 14, 2014, 1:44am UTC](https://forum.ansible.com/t/creating-a-gce-instance-from-a-snapshot/14871/5 "2014-04-14T01:44:49Z")

</div>

I just sent a PR:  
[https://github.com/ansible/ansible/pull/6976](https://github.com/ansible/ansible/pull/6976)
