def _create_disk(<EOL>self,<EOL>name,<EOL>spec,<EOL>template_repo=None,<EOL>template_store=None,<EOL>):
LOGGER.debug("<STR_LIT>" % spec)<EOL>with LogTask("<STR_LIT>" % spec['<STR_LIT:name>']):<EOL><INDENT>disk_metadata = {}<EOL>if spec['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>disk_path, disk_metadata = self._handle_template(<EOL>host_name=name,<EOL>template_spec=spec,<EOL>template_repo=template_repo,<EOL>template_store=template_store,<EOL>)<EOL><DEDENT>elif spec['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>disk_path, disk_metadata = self._handle_empty_disk(<EOL>host_name=name,<EOL>disk_spec=spec,<EOL>)<EOL><DEDENT>elif spec['<STR_LIT:type>'] == '<STR_LIT:file>':<EOL><INDENT>disk_path, disk_metadata = self._handle_file_disk(<EOL>disk_spec=spec,<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>' % str(spec))<EOL><DEDENT>return disk_path, disk_metadata<EOL><DEDENT>
Creates a disc with the given name from the given repo or store

Args:
    name (str): Name of the domain to create the disk for
    spec (dict): Specification of the disk to create
    template_repo (TemplateRepository or None): template repo instance
        to use
    template_store (TemplateStore or None): template store instance to
        use

Returns:
    Tuple(str, dict): Path to the disk and disk metadata

Raises:
    RuntimeError: If the type of the disk is not supported or failed to
        create the disk