def make_storage_volume_job(uuid, name, pool_name, format,
                            capacity, allocation, unit, order):
    cmdname = u"Create Storage Volume"
    cmd = VIRT_COMMAND_CREATE_STORAGE_VOLUME

    options = {}
    options['volume_name'] = uuid
    options['name'] = name
    options['pool_name'] = pool_name
    options['format'] = format
    options['capacity'] = capacity
    options['allocation'] = allocation
    options['unit'] = unit
    options['permission_owner'] = pwd.getpwnam(STORAGE_VOLUME_PWD["OWNER"])[2]
    options['permission_group'] = pwd.getpwnam(STORAGE_VOLUME_PWD["GROUP"])[2]
    options['permission_mode'] = STORAGE_VOLUME_PWD["MODE"]
    options['use'] = DISK_USES["IMAGES"]

    _cmd = dict2command(
        "%s/%s" % (karesansui.config['application.bin.dir'], cmd), options)

    rollback_options = {}
    #rollback_options["name"] = name
    rollback_options["name"] = uuid
    rollback_options["pool_name"] = pool_name
    rollback_options["use"] = DISK_USES["IMAGES"]

    rollback_cmd = dict2command(
        "%s/%s" % (karesansui.config['application.bin.dir'], VIRT_COMMAND_DELETE_STORAGE_VOLUME),
        rollback_options)

    _job = Job('%s command' % cmdname, order, _cmd)
    # delete_guestコマンドが削除まで担当してくれるので、ここではロールバックコマンドを設定しない。
    #_job.rollback_command = rollback_cmd
    return _job
dataset/ETHPy150Open karesansui/karesansui/karesansui/gadget/guest.py/make_storage_volume_job/original