Files
ubicloud/migrate/20250124_vm_add_cpulimits.rb
Maciek Sarnowicz ab59c115c2 Migration for cpu limits on a vm
Adding two columns that track the cpu percent limit that a VM is allowed to use from the overall total of cpu percentage on a host. At the host the total is equal to #cpus * 100%. So for a 96 cpu host, that is 9600% of cpu. Each VM is given a portion of that. For example standard-2 uses 200% out of 9600% of total cpu on a host.
The second column tracks the amount of cpu percent that a VM is allowed to burst into. This will be used for burstable VMs introduced in subsequent commits.

Combining those two for an ease of deployment.
2025-01-28 17:16:51 -08:00

11 lines
227 B
Ruby

# frozen_string_literal: true
Sequel.migration do
change do
alter_table(:vm) do
add_column :cpu_percent_limit, :integer, null: true
add_column :cpu_burst_percent_limit, :integer, null: true
end
end
end