Is it possible to limit the number and speed of paralel STORAGE migrations?

This is a multi-part message in MIME format. --------------000203080307020305010009 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Ovirt uses dd and qemu-img for live migration. Is it possible to limit the number of concurrent live storage moves or limit the bandwidth used? I'd like to move about 30 disks to another storage during the night, but each takes about 30 minutes each and if more than one runs, it chokes my storage. -- Ernest Beinrohr, AXON PRO Ing <http://www.beinrohr.sk/ing.php>, RHCE <http://www.beinrohr.sk/rhce.php>, RHCVA <http://www.beinrohr.sk/rhce.php>, LPIC <http://www.beinrohr.sk/lpic.php>, VCA <http://www.beinrohr.sk/vca.php>, +421-2-62410360 +421-903-482603 --------------000203080307020305010009 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body bgcolor="#FFFFFF" text="#000000"> Ovirt uses dd and qemu-img for live migration. Is it possible to limit the number of concurrent live storage moves or limit the bandwidth used?<br> <br> <br> I'd like to move about 30 disks to another storage during the night, but each takes about 30 minutes each and if more than one runs, it chokes my storage. <br> <br> <div class="moz-signature">-- <br> <div id="oernii_footer" style="color: gray;"> <span style="font-family: Lucida Console, Luxi Mono, Courier, monospace; font-size: 90%;"> Ernest Beinrohr, AXON PRO<br> <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/ing.php">Ing</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCE</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCVA</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/lpic.php">LPIC</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/vca.php">VCA</a>, <br> +421-2-62410360 +421-903-482603 <br> </span> </div> <img src="http://nojsstats.appspot.com/UA-44497096-1/email.beinrohr.sk" moz-do-not-send="true" border="0" width="1" height="1"> </div> </body> </html> --------------000203080307020305010009--

Why not just script them to migrate one after the other? The CLI is nice and simple, and the SDK is even nicer On Tue, Apr 21, 2015 at 11:29 AM, Ernest Beinrohr < Ernest.Beinrohr@axonpro.sk> wrote:
Ovirt uses dd and qemu-img for live migration. Is it possible to limit the number of concurrent live storage moves or limit the bandwidth used?
I'd like to move about 30 disks to another storage during the night, but each takes about 30 minutes each and if more than one runs, it chokes my storage.
-- Ernest Beinrohr, AXON PRO Ing <http://www.beinrohr.sk/ing.php>, RHCE <http://www.beinrohr.sk/rhce.php>, RHCVA <http://www.beinrohr.sk/rhce.php>, LPIC <http://www.beinrohr.sk/lpic.php>, VCA <http://www.beinrohr.sk/vca.php>, +421-2-62410360 +421-903-482603
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

This is a multi-part message in MIME format. --------------000406070305040405010107 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Dňa 21.04.2015 o 17:33 Dan Yasny napísal(a):
Why not just script them to migrate one after the other? The CLI is nice and simple, and the SDK is even nicer Well I gave it a try, but I'm quite new to python and this does not work as expected:
for vm in vms: print vm.name for disk in vm.disks.list( ): print " disk: " + disk.name sd = api.storagedomains.get('newstorage') disk.move(params.Disk(storage_domains=params.StorageDomains(storage_domain=[sd]))) status: 500 reason: Internal Server Error detail: HTTP Status 500 - Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.MovableResource.move(org.ovirt.engine.api.model.Action) ( org.ovirt.engine.api.model.Disk org.ovirt.engine.api.model.Disk@6a0db58b ) -- Ernest Beinrohr, AXON PRO Ing <http://www.beinrohr.sk/ing.php>, RHCE <http://www.beinrohr.sk/rhce.php>, RHCVA <http://www.beinrohr.sk/rhce.php>, LPIC <http://www.beinrohr.sk/lpic.php>, VCA <http://www.beinrohr.sk/vca.php>, +421-2-62410360 +421-903-482603 --------------000406070305040405010107 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">Dňa 21.04.2015 o 17:33 Dan Yasny napísal(a):<br> </div> <blockquote cite="mid:CALLXwb6s2S-mDdXFQ9aPbEYwT1SzFS_pG8r2wxS6djEQHnaHfA@mail.gmail.com" type="cite"> <div dir="ltr">Why not just script them to migrate one after the other? The CLI is nice and simple, and the SDK is even nicer</div> </blockquote> Well I gave it a try, but I'm quite new to python and this does not work as expected:<br> <br> for vm in vms:<br> print vm.name<br> for disk in vm.disks.list( ):<br> print " disk: " + disk.name<br> sd = api.storagedomains.get('newstorage')<br> disk.move(params.Disk(storage_domains=params.StorageDomains(storage_domain=[sd])))<br> <br> <br> status: 500<br> reason: Internal Server Error<br> detail: HTTP Status 500 - Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.MovableResource.move(org.ovirt.engine.api.model.Action) ( org.ovirt.engine.api.model.Disk org.ovirt.engine.api.model.Disk@6a0db58b )<br> <br> <div class="moz-signature">-- <br> <div id="oernii_footer" style="color: gray;"> <span style="font-family: Lucida Console, Luxi Mono, Courier, monospace; font-size: 90%;"> Ernest Beinrohr, AXON PRO<br> <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/ing.php">Ing</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCE</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCVA</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/lpic.php">LPIC</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/vca.php">VCA</a>, <br> +421-2-62410360 +421-903-482603 <br> </span> </div> <img src="http://nojsstats.appspot.com/UA-44497096-1/email.beinrohr.sk" moz-do-not-send="true" border="0" width="1" height="1"> </div> </body> </html> --------------000406070305040405010107--

On 04/22/2015 11:44 AM, Ernest Beinrohr wrote:
Dňa 21.04.2015 o 17:33 Dan Yasny napísal(a):
Why not just script them to migrate one after the other? The CLI is nice and simple, and the SDK is even nicer Well I gave it a try, but I'm quite new to python and this does not work as expected:
for vm in vms: print vm.name for disk in vm.disks.list( ): print " disk: " + disk.name sd = api.storagedomains.get('newstorage')
disk.move(params.Disk(storage_domains=params.StorageDomains(storage_domain=[sd])))
status: 500 reason: Internal Server Error detail: HTTP Status 500 - Bad arguments passed to public abstract javax.ws.rs.core.Response org.ovirt.engine.api.resource.MovableResource.move(org.ovirt.engine.api.model.Action) ( org.ovirt.engine.api.model.Disk org.ovirt.engine.api.model.Disk@6a0db58b )
The parameter to the "move" method should be an "Action", containing a reference to the target storage domain. You need something like this: ---8<--- #!/usr/bin/python import time from ovirtsdk import api from ovirtsdk.xml import params # Connect to the server: api = api.API( url="https://ovirt.example.com/ovirt-engine/api", username="admin@internal", password="***", insecure=True, debug=False ) # Find the VM whose disks we want to move: vm = api.vms.get(name="myvm") # Create the information of the storage domain where we will # move the disks to. Note that we only need to know the name # (or id) of the storage domain, the server will locate it so # we don't need to look it up here: sd = params.StorageDomain(name="newstorage") # Iterate the disks of the VM and for each of them move it # to the target storage domain: for disk in vm.disks.list(): # Start moving the disk. Note that this is an asynchronous # operation, so once the "move" method returns you will # have to wait for the actual movement to finish. print("Moving disk \"%s\" ..." % disk.get_alias()) disk.move( params.Action( storage_domain=sd ) ) # Wait till the state of the disk is "ok", which means it # has been moved completely. Note that it is important to # wait a few seconds before doing the first check, as # otherwise you will get the status of the disk before # the movement started, thus you would get "ok" but # because the movement didn't start yet. disk_id = disk.get_id() while True: print("Waiting for movement to complete ...") time.sleep(5) disk = vm.disks.get(id=disk_id) if disk.get_status().get_state() == "ok": break # Bye: api.disconnect() --->8--- -- Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.

This is a multi-part message in MIME format. --------------020004080101080804050901 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Dňa 22.04.2015 o 13:09 Juan Hernández napísal(a):
# Iterate the disks of the VM and for each of them move it # to the target storage domain: for disk in vm.disks.list(): # Start moving the disk. Note that this is an asynchronous # operation, so once the "move" method returns you will # have to wait for the actual movement to finish. print("Moving disk \"%s\" ..." % disk.get_alias()) disk.move( params.Action( storage_domain=sd ) ) This works nicely, thank you.
-- Ernest Beinrohr, AXON PRO Ing <http://www.beinrohr.sk/ing.php>, RHCE <http://www.beinrohr.sk/rhce.php>, RHCVA <http://www.beinrohr.sk/rhce.php>, LPIC <http://www.beinrohr.sk/lpic.php>, VCA <http://www.beinrohr.sk/vca.php>, +421-2-62410360 +421-903-482603 --------------020004080101080804050901 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">Dňa 22.04.2015 o 13:09 Juan Hernández napísal(a): </div> <blockquote cite="mid:55378153.8050203@redhat.com" type="cite"> <pre wrap=""> # Iterate the disks of the VM and for each of them move it # to the target storage domain: for disk in vm.disks.list(): # Start moving the disk. Note that this is an asynchronous # operation, so once the "move" method returns you will # have to wait for the actual movement to finish. print("Moving disk \"%s\" ..." % disk.get_alias()) disk.move( params.Action( storage_domain=sd ) ) </pre> </blockquote> This works nicely, thank you.<br> <br> <div class="moz-signature">-- <br> <div id="oernii_footer" style="color: gray;"> <span style="font-family: Lucida Console, Luxi Mono, Courier, monospace; font-size: 90%;"> Ernest Beinrohr, AXON PRO<br> <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/ing.php">Ing</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCE</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/rhce.php">RHCVA</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/lpic.php">LPIC</a>, <a style="text-decoration: none; color: gray;" href="http://www.beinrohr.sk/vca.php">VCA</a>, <br> +421-2-62410360 +421-903-482603 <br> </span> </div> <img src="http://nojsstats.appspot.com/UA-44497096-1/email.beinrohr.sk" moz-do-not-send="true" border="0" width="1" height="1"> </div> </body> </html> --------------020004080101080804050901--
participants (3)
-
Dan Yasny
-
Ernest Beinrohr
-
Juan Hernández