Skip to content

Instantly share code, notes, and snippets.

@PaulRashidi
Created June 25, 2013 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PaulRashidi/cda9acb5e673c0f1d34e to your computer and use it in GitHub Desktop.
Save PaulRashidi/cda9acb5e673c0f1d34e to your computer and use it in GitHub Desktop.
How to reset your Google Compute Engine instance using gcutil's new resetinstance function.
testuser@desktop:~/$ gcutil --project=google.com:testproject --format=json resetinstance --zone=us-central1-b test1
INFO: Waiting for reset of instance test1. Sleeping for 3s.
{
"items": [
{
"id": "9465765453221150149",
"insertTime": "2013-06-24T13:26:39.140-07:00",
"kind": "compute#operation",
"name": "operation-1372104599140-4dfec3be443a1-7b2e3d3e",
"operationType": "reset",
"progress": 100,
"selfLink": "https://www.googleapis.com/compute/v1beta15/projects/google.com:test-compute/zones/us-central1-b/operations/operation-1372104599140-4dfec3be443a1-7b2e3d3e",
"startTime": "2013-06-24T13:26:39.216-07:00",
"status": "DONE",
"targetId": "1661082487669788126",
"targetLink": "https://www.googleapis.com/compute/v1beta15/projects/google.com:test-compute/zones/us-central1-b/instances/test1",
"user": "paulr-testuser@gmail.com",
"zone": "https://www.googleapis.com/compute/v1beta15/projects/google.com:test-compute/zones/us-central1-b"
},
{
"canIpForward": false,
"creationTimestamp": "2013-06-24T13:06:03.336-07:00",
"description": "",
"disks": [
{
"index": 0,
"kind": "compute#attachedDisk",
"mode": "READ_WRITE",
"type": "SCRATCH"
}
],
"id": "1661082487669788126",
"image": "https://www.googleapis.com/compute/v1beta15/projects/debian-cloud/global/images/debian-7-wheezy-v20130617",
"kind": "compute#instance",
"machineType": "https://www.googleapis.com/compute/v1beta15/projects/google.com:test-compute/zones/us-central1-b/machineTypes/n1-standard-1",
"metadata": {
"fingerprint": "42TrSpB8rSM=",
"kind": "compute#metadata"
},
"name": "test1",
"networkInterfaces": [
{
"accessConfigs": [
{
"kind": "compute#accessConfig",
"name": "External NAT",
"natIP": "192.168.Y.Y",
"type": "ONE_TO_ONE_NAT"
}
],
"name": "nic0",
"network": "https://www.googleapis.com/compute/v1beta15/projects/google.com:test-compute/global/networks/default",
"networkIP": "10.240.X.X"
}
],
"selfLink": "https://www.googleapis.com/compute/v1beta15/projects/google.com:test-compute/zones/us-central1-b/instances/test1",
"status": "RUNNING",
"tags": {
"fingerprint": "42TrSpB8rSM="
},
"zone": "https://www.googleapis.com/compute/v1beta15/projects/google.com:test-compute/zones/us-central1-b"
}
],
"kind": "compute#operationList",
"note": "This JSON result is based on multiple API calls. This object was created in the client."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment