[Openstack-operators] Updating flavor quotas (e.g. disk_iops) on existing instances.

Van Leeuwen, Robert rovanleeuwen at ebay.com
Wed Jul 13 06:09:32 UTC 2016


>> 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



More information about the OpenStack-operators mailing list