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

nsoffer at redhat.com nsoffer at redhat.com
Mon Mar 30 17:00:30 UTC 2015


Nir Soffer has posted comments on this change.

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


Patch Set 1:

(4 comments)

Lets move this to jobs.py module, and use this for the new tasks infrastructure, replacing spm tasks :-)

v2v can import jobs and use it for getting v2v jobs.

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?

If not, we should allow getting the ovf when job does not exists.
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?

These are not vdsm errors, so log: "Cannot get converted vm..."

All these are client errors, so there is no need for warning - there is nothing wrong with vdsm but the client asking for non-existent resource.

Note that these warnings go to /var/log/syslog, and it is not ok to spam syslog with warnings about bad clients.

A loggging.info or logging.debug would be enough. If we disable warnings in syslog for vdsm or for this logger, you can use warning.
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?

These are not vdsm errors, so log "Cannot delete job..."
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, or V2VProcessError which should log an error.

So we need separate handling for client errors and v2v errors.

Lets add ClientError exception for client related errors. V2VError should be used only for errors in v2v or virt-v2v process. Same logic as in http (4xx - client error, 5xx - server error).
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: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list