  def CreateDiskFromImage(
      self,
      src_image: 'GoogleComputeImage',
      zone: str,
      name: Optional[str] = None) -> 'GoogleComputeDisk':
    """Creates a GCE persistent disk from a GCE image.

    Args:
      src_image (GoogleComputeImage): Source image for the disk.
      zone (str): Zone to create the new disk in.
      name (str): Optional. Name of the disk to create. Default
          is [src_image.name]-[TIMESTAMP('%Y%m%d%H%M%S')].

    Returns:
      GoogleComputeDisk: A Google Compute Disk object.

    Raises:
      InvalidNameError: If GCE disk name is invalid.
    """

    if name:
      if not common.REGEX_DISK_NAME.match(name):
        raise errors.InvalidNameError(
            'Disk name {0:s} does not comply with {1:s}'.format(
                name, common.REGEX_DISK_NAME.pattern),
            __name__)
      name = name[:common.COMPUTE_NAME_LIMIT]
    else:
      name = common.GenerateUniqueInstanceName(
          src_image.name, common.COMPUTE_NAME_LIMIT)

    disk_body = {
        'name':
            name,
        'sourceImage':
            'projects/{project_id}/global/images/{src_image}'.format(
                project_id=src_image.project_id, src_image=src_image.name)
    }
    gce_disk_client = self.GceApi().disks() # pylint: disable=no-member
    request = gce_disk_client.insert(
        project=self.project_id, body=disk_body, zone=zone)
    response = request.execute()
    self.BlockOperation(response, zone)
    return GoogleComputeDisk(self.project_id, zone, name)
Creates a GCE persistent disk from a GCE image.

Args:
src_image (GoogleComputeImage): Source image for the disk.
zone (str): Zone to create the new disk in.
name (str): Optional. Name of the disk to create. Default
is [src_image.name]-[TIMESTAMP('%Y%m%d%H%M%S')].

Returns:
GoogleComputeDisk: A Google Compute Disk object.

Raises:
InvalidNameError: If GCE disk name is invalid.
libcloudforensics/providers/gcp/internal/compute.py