def create(self, **kwargs): # Name - full device name (google created link name) name = kwargs.get('name') if not name: raise storage.StorageError( 'Device_name attribute should be non-empty') device = '/dev/disk/by-id/google-%s' % name if not os.path.exists(device): raise storage.StorageError("Device '%s' not found" % device) kwargs['device'] = device super(GceEphemeralVolumeProvider, self).create(**kwargs)
def destroy_snapshot(self, snap): try: connection = __node__['gce']['compute_connection'] project_id = __node__['gce']['project_id'] op = connection.snapshots().delete(project=project_id, snapshot=snap.name).execute() wait_for_operation_to_complete(connection, project_id, op['name']) except: e = sys.exc_info()[1] raise storage.StorageError('Failed to delete google disk snapshot.' ' Error: %s' % e)
def create_from_snapshot(self, **kwargs): raise storage.StorageError("Can't create from snapshot - attaching to " "running instances is unsupported")
def create_from_snapshot(self, **kwargs): raise storage.StorageError("GCE ephemeral disks have no snapshots.")
def create_snapshot(self, vol, snap, **kwargs): raise storage.StorageError("Snapshotting is unsupported by GCE" "ephemeral disks.")