0
votes

I am trying to create a compute engine disk using python. I am using source snap shot for creating the disk.

This is the code I am using for creation:

COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/beta/'


def GenerateConfig(unused_context):
   """Creates the second virtual machine."""

resources = [{
  'name': 'MY_SNAP',
  'type': 'compute.beta.disk',
  'properties': {
      'zone': 'us-central1-a',
      'sizeGb': 10,
      'sourceSnapShot' :'global/snapshots/MY_SNAPSHOT', 
      }
  }
]
return {'resources': resources}

Here the disk is getting created, but snap shot is not getting attached with it.

I have created the snapshot through the google console.

1

1 Answers

0
votes

sourceSnapshot should not have a capital 'S' in 'shot'. Try again with the correct capitalization.