[ovirt-users] Query on VM Clone

Karli Sjöberg karli at inparadise.se
Thu Mar 29 11:02:01 UTC 2018


On Thu, 2018-03-29 at 11:21 +0200, Ondra Machacek wrote:
> On 03/29/2018 11:09 AM, Hari Prasanth Loganathan wrote:
> > Hi Team,
> > 
> > 1) I perform the VM clone using the following API
> > 
> > api/vms/{vmId}/clone
> > 
> > 2) The above API is returning the job id
> > 3) Using the job Id, we continuously query the oVirt to get the
> > status 
> > of the clone operation.
> > /api/jobs/${vmCloneJobId}
> >      We are able to successfully get the status of the clone
> > operation.
> > 
> > But the problem is, we are not able to identify the newly created
> > VM 
> > (created using clone).
> > 
> > AFAIK, The only way to get the newly created VM is to get all the
> > VM 
> > list from oVirt. Is there an easy way to identify the newly created
> > VM 
> > using the jobId?
> 
> In order to run the clone operation you must pas the VM name, so you 
> know the name, so later to fetch the VM you can just run:
> 
> api/vms?search=name=thenameofclonnedvm

Hijacking this a little, because I got curious about something:)

Is it possible to do regex searches? Because I remember working on
something different, the searches could potentially end up with
multiple matched objects, like "thenameofclonnedvm",
"thenameofclonnedvm-berta", "thenameofclonnedvm3" and so on. So I was
always forced to treat the result as a potential array, loop the
objects (this was with Python) and test for an exact match, even if it
was just one object. So it would be nicer if you could go like:

api/vms?search=name='^thenameofclonnedvm$'

And be sure to have an exact match every time. Is that possible?

TIA

/K

> 
> Is this approach OK for you?
> 
> > 
> > Thanks,
> > Hari
> > 
> > DISCLAIMER
> > 
> > The information in this e-mail is confidential and may be subject
> > to 
> > legal privilege. It is intended solely for the addressee. Access to
> > this 
> > e-mail by anyone else is unauthorized. If you have received this 
> > communication in error, please address with the subject heading 
> > "Received in error," send to it at msystechnologies.com 
> > <mailto:it at msystechnologies.com>,  then delete the e-mail and
> > destroy 
> > any copies of it. If you are not the intended recipient, any
> > disclosure, 
> > copying, distribution or any action taken or omitted to be taken
> > in 
> > reliance on it, is prohibited and may be unlawful. The views,
> > opinions, 
> > conclusions and other information expressed in this electronic mail
> > and 
> > any attachments are not given or endorsed by the company unless 
> > otherwise indicated by an authorized representative independent of
> > this 
> > message.
> > 
> > MSys cannot guarantee that e-mail communications are secure or 
> > error-free, as information could be intercepted, corrupted,
> > amended, 
> > lost, destroyed, arrive late or incomplete, or contain viruses,
> > though 
> > all reasonable precautions have been taken to ensure no viruses
> > are 
> > present in this e-mail. As our company cannot accept responsibility
> > for 
> > any loss or damage arising from the use of this e-mail or
> > attachments we 
> > recommend that you subject these to your virus checking procedures
> > prior 
> > to use
> > 
> > 
> > _______________________________________________
> > Users mailing list
> > Users at ovirt.org
> > http://lists.ovirt.org/mailman/listinfo/users
> > 
> 
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ovirt.org/pipermail/users/attachments/20180329/460091f8/attachment.sig>


More information about the Users mailing list