-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
API
CLOUDSTACK VERSION
Issue was reproduced on (probably it happens also on 4.13.0, 4.13.1):
4.12.0.0,
4.14.0.0,
master (4.15.0.0)
OS / ENVIRONMENT
VMs are running on KVM nodes.
SUMMARY
When changing the service offering of a VM from an offering that has bytes_read_rate_max configured, the VM does not update bytes_read_rate_max.
For instance, if the new offering has bytes_read_rate higher than the previous offering bytes_read_rate_max then the VM will fail to start after changing to the new offering.
STEPS TO REPRODUCE
Let's assume the follwoing offerings:
mysql> select name, type, bytes_write_rate, bytes_write_rate_max from disk_offering where name="OldOffering" or name="NewOffering";
+---------------+---------+------------------+----------------------+
| name | type | bytes_write_rate | bytes_write_rate_max |
+---------------+---------+------------------+----------------------+
| OldOffering | Service | 268435456 | 402653184 |
| NewOffering | Service | 536870912 | 805306368 |
+---------------+---------+------------------+----------------------+
- Deploy VM with offering OldOffering
(...)
<iotune>
<write_bytes_sec>268435456</write_bytes_sec>
(...)
<write_bytes_sec_max>402653184</write_bytes_sec_max>
(...)
</iotune>
(...)
-
Stopped VM and changed offering to NewOffering (via
changeServiceForVirtualMachinecommand) -
VM fails to start with NewOffering.
2020-06-02 09:28:53,882 WARN [resource.wrapper.LibvirtStartCommandWrapper] (agentRequest-Handler-3:null) (logid:7e3f6a86) LibvirtException
org.libvirt.LibvirtException: internal error: process exited while connecting to monitor: 2020-06-02T12:28:53.743449Z qemu-system-x86_64: -drive file=/mnt/37c2fbd0-8518-3c47-872d-1a1bc772372a/93164fa0-d5ae-417f-8e23-10303163c8c3,format=qcow2,if=none,id=drive-ide0-0-0,ser
ial=93164fa0d5ae417f8e23,cache=none,throttling.bps-read=536870912,throttling.bps-write=536870912,throttling.iops-read=2000,throttling.iops-write=1000,throttling.bps-read-max=805306368,throttling.bps-write-max=402653184: 'serial' is deprecated, please use the correspondin
g option of '-device' instead
2020-06-02T12:28:53.743499Z qemu-system-x86_64: -drive file=/mnt/37c2fbd0-8518-3c47-872d-1a1bc772372a/93164fa0-d5ae-417f-8e23-10303163c8c3,format=qcow2,if=none,id=drive-ide0-0-0,serial=93164fa0d5ae417f8e23,cache=none,throttling.bps-read=536870912,throttling.bps-write=536
870912,throttling.iops-read=2000,throttling.iops-write=1000,throttling.bps-read-max=805306368,throttling.bps-write-max=402653184: bps_max/iops_max cannot be lower than bps/iops
at org.libvirt.ErrorHandler.processError(Unknown Source)
Note that throttling.bps-write=536870912 is higher than throttling.bps-write-max=402653184, which results on the above exception (bps_max/iops_max cannot be lower than bps/iops)
The XML file used by Libvirt holds the following values on <iotune> section:
(...)
<iotune>
<write_bytes_sec>536870912</write_bytes_sec>
(...)
<write_bytes_sec_max>402653184</write_bytes_sec_max>
(...)
</iotune>
(...)
EXPECTED RESULTS
- Deployed VM with offering OldOffering
(...)
<iotune>
<write_bytes_sec>268435456</write_bytes_sec>
(...)
<write_bytes_sec_max>402653184</write_bytes_sec_max>
(...)
</iotune>
(...)
-
Stopped VM and changed offering to NewOffering
-
VM starts with NewOffering without any problem. XML updates the <iotune rate accordingly to the offering.
(...)
<iotune>
<write_bytes_sec>536870912</write_bytes_sec>
(...)
<write_bytes_sec_max>805306368</write_bytes_sec_max>
(...)
</iotune>
(...)
Observation:
All seems to be working fine when changing the offering via UI (API command scaleVirtualMachine). The problem, therefore, is related to the API command changeServiceForVirtualMachine.