Hello, Yes, You're right that make it with virsh will work only until next hard reboot/stop/suspend/migrate of instance but I thought only about changing flavor extra-specs and apply it to running vms with virsh :) Also I think that updating flavor extra-specs can be probably done also through nova API. Please check "nova flavor-key" command.
-- Best regards / Pozdrawiam Sławek Kapłoński [email protected] On Wed, 13 Jul 2016, Van Leeuwen, Robert wrote: > >> Since the instance_extra flavor table is a big JSON blob it is a pain to > >> apply changes there. > >> Anybody found an easy way to do this? > > If You are using virsh, You can apply such limits manually for each > > instance. Check blkiotune command in virsh. > > Using virsh is only for the running instances until the next reboot. > This is because OpenStack will re-create the .xml file when you reboot an > instance and any “local changes” made by virsh will be gone. > > As I mentioned this info is not re-read from the flavor when the XML is > created but it is stored per-instance in the instance_extra.flavor table. > Luckily you can just overwrite the instance_extra.flavor with one with a > quota applied to it and you do not need to parse and modify the JSON-BLOB. > (the JSON-BLOB does not seem to contain unique data for the instance) > > For future reference, the sql query will look something like this: > update instance_extra set flavor='BIG JSON BLOB HERE' where instance_uuid IN > ( SELECT uuid from instances where instances.instance_type_id='10' and > instances.deleted='0') ; > > This will update all active instances with the flavor-id of 10 (note that > this flavor-id is an auto-increment id and not the flavor-id you use when > creating a flavor) > You can get the “JSON BLOB” from an instance which was created with the new > extra_specs settings applied to it. > This setting will only be applied when you (hard)reboot the instance. > When you want to instances without rebooting them you will ALSO need to to > the virsh blkiotune part. > > I’d gladly hear to any suggestions/tools for an easier way to do it. > > Cheers, > Robert van Leeuwen >
signature.asc
Description: Digital signature
_______________________________________________ OpenStack-operators mailing list [email protected] http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
