  def CreateDiskFromSnapshot(
      self,
      snapshot: 'GoogleComputeSnapshot',
      disk_name: Optional[str] = None,
      disk_name_prefix: Optional[str] = None,
      disk_type: str = 'pd-standard') -> 'GoogleComputeDisk':
    """Create a new disk based on a Snapshot.

    Args:
      snapshot (GoogleComputeSnapshot): Snapshot to use.
      disk_name (str): Optional. String to use as new disk name.
      disk_name_prefix (str): Optional. String to prefix the disk name with.
      disk_type (str): Optional. URL of the disk type resource describing
          which disk type to use to create the disk. Default is pd-standard. Use
          pd-ssd to have a SSD disk. You can list all available disk types by
          running the following command: gcloud compute disk-types list

    Returns:
      GoogleComputeDisk: Google Compute Disk.

    Raises:
      ResourceAlreadyExistsError: If the disk already exists.
      ResourceCreationError: If the disk could not be created.
    """

    if not disk_name:
      disk_name = common.GenerateDiskName(snapshot, disk_name_prefix)
    body = {
        'name':
            disk_name,
        'sourceSnapshot':
            snapshot.GetSourceString(),
        'type':
            'projects/{0:s}/zones/{1:s}/diskTypes/{2:s}'.format(
                self.project_id, self.default_zone, disk_type)
    }
    try:
      gce_disks_client = self.GceApi().disks() # pylint: disable=no-member
      request = gce_disks_client.insert(
          project=self.project_id, zone=self.default_zone, body=body)
      response = request.execute()
    except HttpError as exception:
      if exception.resp.status == 409:
        raise errors.ResourceAlreadyExistsError(
            'Disk {0:s} already exists: {1!s}'.format(disk_name, exception),
            __name__) from exception
      raise errors.ResourceCreationError(
          'Unknown error occurred when creating disk from Snapshot:'
          ' {0!s}'.format(exception),
          __name__) from exception
    self.BlockOperation(response, zone=self.default_zone)
    return GoogleComputeDisk(
        project_id=self.project_id, zone=self.default_zone, name=disk_name)
Create a new disk based on a Snapshot.

Args:
snapshot (GoogleComputeSnapshot): Snapshot to use.
disk_name (str): Optional. String to use as new disk name.
disk_name_prefix (str): Optional. String to prefix the disk name with.
disk_type (str): Optional. URL of the disk type resource describing
which disk type to use to create the disk. Default is pd-standard. Use
pd-ssd to have a SSD disk. You can list all available disk types by
running the following command: gcloud compute disk-types list

Returns:
GoogleComputeDisk: Google Compute Disk.

Raises:
ResourceAlreadyExistsError: If the disk already exists.
ResourceCreationError: If the disk could not be created.
libcloudforensics/providers/gcp/internal/compute.py