This change introduces the rhizome library and executable to manage the creation and deletion of slices. Slices will form the foundation for controlling VM resource usage in future updates. This functionality will enable support for burstable VM instances.
43 lines
798 B
Ruby
Executable File
43 lines
798 B
Ruby
Executable File
#!/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require_relative "../lib/slice_setup"
|
|
|
|
unless (action = ARGV.shift)
|
|
puts "expected action as argument"
|
|
exit 1
|
|
end
|
|
|
|
unless (slice_name = ARGV.shift)
|
|
puts "expected slice name as argument"
|
|
exit 1
|
|
end
|
|
|
|
slice_setup = SliceSetup.new(slice_name)
|
|
|
|
case action
|
|
when "delete"
|
|
slice_setup.purge
|
|
|
|
when "prep"
|
|
unless (allowed_cpus = ARGV.shift)
|
|
puts "expected list of allowed cpus as argument"
|
|
exit 1
|
|
end
|
|
slice_setup.prep(allowed_cpus)
|
|
|
|
when "recreate-unpersisted"
|
|
slice_setup.start_systemd_unit
|
|
|
|
when "reinstall-systemd-units"
|
|
unless (allowed_cpus = ARGV.shift)
|
|
puts "expected list of allowed cpus as argument"
|
|
exit 1
|
|
end
|
|
slice_setup.install_systemd_unit(allowed_cpus)
|
|
|
|
else
|
|
puts "Invalid action #{action}"
|
|
exit 1
|
|
end
|