diff --git a/providers/google-compute-engine/pom.xml b/providers/google-compute-engine/pom.xml
index f440a0f136..9edc75e1e9 100644
--- a/providers/google-compute-engine/pom.xml
+++ b/providers/google-compute-engine/pom.xml
@@ -37,9 +37,9 @@
Private key (PKCS12 file) associated with the Google API client_id
- v1beta16
+ v1
- osFamily=GCEL,osVersionMatches=1[012].[01][04],locationId=us-central1-a,minRam=2048
+ imageId=debian-7-wheezy-v20131120,locationId=us-central1-a,minRam=2048
diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
index 6589c4d30b..6918d279f1 100644
--- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
+++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java
@@ -27,7 +27,6 @@ import org.jclouds.googlecomputeengine.features.FirewallApi;
import org.jclouds.googlecomputeengine.features.GlobalOperationApi;
import org.jclouds.googlecomputeengine.features.ImageApi;
import org.jclouds.googlecomputeengine.features.InstanceApi;
-import org.jclouds.googlecomputeengine.features.KernelApi;
import org.jclouds.googlecomputeengine.features.MachineTypeApi;
import org.jclouds.googlecomputeengine.features.NetworkApi;
import org.jclouds.googlecomputeengine.features.ProjectApi;
@@ -47,7 +46,7 @@ import com.google.common.annotations.Beta;
*
*
* @author David Alves
- * @see api doc
+ * @see api doc
*/
@Beta
public interface GoogleComputeEngineApi extends Closeable {
@@ -106,15 +105,6 @@ public interface GoogleComputeEngineApi extends Closeable {
@Path("/projects/{project}")
InstanceApi getInstanceApiForProject(@PathParam("project") String projectName);
- /**
- * Provides access to Kernel features
- *
- * @param projectName the name of the project
- */
- @Delegate
- @Path("/projects/{project}")
- KernelApi getKernelApiForProject(@PathParam("project") String projectName);
-
/**
* Provides access to MachineType features
*
diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
index 564f869f3d..d6bb755669 100644
--- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
+++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java
@@ -40,7 +40,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
- * Implementation of {@link ApiMetadata} for GoogleCompute v1beta16 API
+ * Implementation of {@link ApiMetadata} for GoogleCompute v1 API
*
* @author David Alves
*/
@@ -80,8 +80,8 @@ public class GoogleComputeEngineApiMetadata extends BaseHttpApiMetadata>builder()
diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java
index 1334a32a17..0bf6b6f515 100644
--- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java
+++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java
@@ -34,6 +34,10 @@ public interface GoogleComputeEngineConstants {
*/
public static final String GOOGLE_PROJECT = "google";
+ public static final String CENTOS_PROJECT = "centos-cloud";
+
+ public static final String DEBIAN_PROJECT = "debian-cloud";
+
public static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute";
public static final String COMPUTE_READONLY_SCOPE = "https://www.googleapis.com/auth/compute.readonly";
@@ -58,4 +62,19 @@ public interface GoogleComputeEngineConstants {
public static final Location GOOGLE_PROVIDER_LOCATION = new LocationBuilder().scope(LocationScope.PROVIDER).id
(GCE_PROVIDER_NAME).description(GCE_PROVIDER_NAME).build();
+
+ /**
+ * The key we look for in instance metadata for the URI for the image the instance was created from.
+ */
+ public static final String GCE_IMAGE_METADATA_KEY = "jclouds-image";
+
+ /**
+ * Metadata key to check for whether we should delete an instance's boot disk when we delete the instance.
+ */
+ public static final String GCE_DELETE_BOOT_DISK_METADATA_KEY = "jclouds-delete-boot-disk";
+
+ /**
+ * The suffix we append to auto-created boot disk names.
+ */
+ public static final String GCE_BOOT_DISK_SUFFIX = "boot-disk";
}
diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
index f4495c0b29..62d3914d32 100644
--- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
+++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java
@@ -20,14 +20,21 @@ import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Iterables.contains;
import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.tryFind;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GOOGLE_PROJECT;
+import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.CENTOS_PROJECT;
+import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.DEBIAN_PROJECT;
+import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_BOOT_DISK_SUFFIX;
+import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_DELETE_BOOT_DISK_METADATA_KEY;
+import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_IMAGE_METADATA_KEY;
import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_INTERVAL;
import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_TIMEOUT;
import static org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig.Type;
+import static org.jclouds.googlecomputeengine.predicates.InstancePredicates.isBootDisk;
import static org.jclouds.util.Predicates2.retry;
import java.net.URI;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
@@ -36,7 +43,6 @@ import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Resource;
import javax.inject.Named;
-import com.google.common.primitives.Ints;
import org.jclouds.collect.Memoized;
import org.jclouds.compute.ComputeServiceAdapter;
import org.jclouds.compute.domain.Hardware;
@@ -49,10 +55,15 @@ import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
import org.jclouds.googlecomputeengine.compute.functions.FirewallTagNamingConvention;
import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions;
import org.jclouds.googlecomputeengine.config.UserProject;
+import org.jclouds.googlecomputeengine.domain.Disk;
import org.jclouds.googlecomputeengine.domain.Image;
import org.jclouds.googlecomputeengine.domain.Instance;
+import org.jclouds.googlecomputeengine.domain.Instance.AttachedDisk;
+import org.jclouds.googlecomputeengine.domain.Instance.PersistentAttachedDisk;
import org.jclouds.googlecomputeengine.domain.InstanceInZone;
import org.jclouds.googlecomputeengine.domain.InstanceTemplate;
+import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk;
+import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk.Mode;
import org.jclouds.googlecomputeengine.domain.MachineType;
import org.jclouds.googlecomputeengine.domain.MachineTypeInZone;
import org.jclouds.googlecomputeengine.domain.Operation;
@@ -64,11 +75,14 @@ import org.jclouds.logging.Logger;
import com.google.common.base.Function;
import com.google.common.base.Objects;
+import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.primitives.Ints;
import com.google.common.util.concurrent.Atomics;
import com.google.common.util.concurrent.UncheckedTimeoutException;
import com.google.inject.Inject;
@@ -85,7 +99,6 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter<
private final GoogleComputeEngineApi api;
private final Supplier userProject;
private final Supplier