Change in vdsm[master]: v2v: Job related actions

shavivi at redhat.com shavivi at redhat.com
Tue Mar 31 07:46:25 UTC 2015


Shahar Havivi has posted comments on this change.

Change subject: v2v: Job related actions
......................................................................


Patch Set 1:

(4 comments)

regarding moving to jobs.py
the following method is tightly coupled with v2v (disk_progress etc)
 
def jobs():
    ret = {}
    with _lock:
        items = tuple(_jobs.items())
    for job_id, job in items:
        ret[job_id] = {
            'status': job.status,
            'status_msg': job.status_msg,
            'disk_progress': job.disk_progress,
            'progress': job.progress
        }
    return ret

https://gerrit.ovirt.org/#/c/39361/1/vdsm/v2v.py
File vdsm/v2v.py:

Line 167: 
Line 168: def get_converted_vm(job_id):
Line 169:     try:
Line 170:         job = _get_job(job_id)
Line 171:         _validate_job_done(job)
> Are jobs restored after restart/crash?
Good point,
It will not survive restart since its in /var/run/...
but crush yes so I guess we can remove the _validate_job_done() check, and just try to get the ovf -
In this case the get_job() will return null as well since its not in memory but the ovf may be in /var/run/vdsm/...

Michal?
Line 172:         ovf = _read_ovf(job_id)
Line 173:     except V2VError as e:
Line 174:         logging.warning('Converted VM error %s', e)
Line 175:         return errCode[e.err_name]


Line 170:         job = _get_job(job_id)
Line 171:         _validate_job_done(job)
Line 172:         ovf = _read_ovf(job_id)
Line 173:     except V2VError as e:
Line 174:         logging.warning('Converted VM error %s', e)
> We get only NoSuchJob, JobNotDone or NoSuchOvf - right?
Done
Line 175:         return errCode[e.err_name]
Line 176:     return {'status': doneCode, 'ovf': ovf}
Line 177: 
Line 178: 


Line 181:         job = _get_job(job_id)
Line 182:         _validate_job_finished(job)
Line 183:         _remove_job(job_id)
Line 184:     except V2VError as e:
Line 185:         logging.warning('Error deleting job: %s, error: %s', job_id, e)
> We get here only NoSuchJob and JobNotFinished - right?
Done
Line 186:         return errCode[e.err_name]
Line 187:     return {'status': doneCode}
Line 188: 
Line 189: 


Line 191:     try:
Line 192:         job = _get_job(job_id)
Line 193:         job.abort()
Line 194:         _remove_job(job_id)
Line 195:     except V2VError as e:
> Here we may get NoSuchJob and JobNotFinished, which should log a warning, o
Done
Line 196:         logging.warning('Error aboring job: %s, error: %s', job_id, e)
Line 197:         return errCode[e.err_name]
Line 198:     return {'status': doneCode}
Line 199: 


-- 
To view, visit https://gerrit.ovirt.org/39361
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9a58583a88e2f17ce0847626cd601efbe1a00ac9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list