'Creates a disk image using dd.
:param img_path: Path to the desired image file.
:param size: Size of the desired image in Bytes.
:return: Path of the image created.'

def _create_disk_img(self, img_path, size):

    logging.debug('Creating    disk    image    %s,    size    =    %d    Bytes', img_path, size)
    try:
        cmd = ('dd    if=/dev/zero    of=%s    bs=1024    count=%d' % (img_path, size))
        utils.run(cmd)
    except error.CmdError as e:
        e_msg = ('Error    creating    disk    image    %s:    %s' % (img_path, e))
        raise error.AutotestError(e_msg)
    return img_path
