wakame-vdc
wakame-vdc copied to clipboard
vdc-manage allows setting non-existant hypervisor
Problem
When modifying a host node's hypervisor, there is no check done to see if the hypervisor is valid.
vdc-manage>> host modify hn-hva1 --hypervisor hvm
vdc-manage>> host show
UUID Node ID Hypervisor Architecture Usage Status Scheduling
hn-hva1 hva.hva1 hvm x86_64 0% online true
Solution
Add a check and fail if the hypervisor being set is invalid.
These are the supported hypervisors. https://github.com/axsh/wakame-vdc/blob/develop/dcmgr/lib/dcmgr/constants/host_node.rb#L17
This is the line that doesn't seem to work. https://github.com/axsh/wakame-vdc/blob/develop/dcmgr/lib/dcmgr/cli/host.rb#L68-L70