sandia-minimega / minimega

minimega
GNU General Public License v3.0
148 stars 68 forks source link

bug: vm config schedule #1298

Closed mkunz7 closed 5 years ago

mkunz7 commented 5 years ago

Describe your environment

  1. minimega version - latest
  2. Linux distro/version - ubuntu 16.04
  3. Go compiler version - 1.10.2
  4. VM types - n/a

Describe the bug vm config schedule doesn't support wildcarding and you can't clear vm config schedule if you provide an invalid server and attempt to launch.

To Reproduce

$ ns add-hosts server2
$ vm config schedule doesnotexist
$ vm config disk test.qcow2
$ vm launch kvm a
Error (server1): VM scheduled on unknown host: `doesnotexist`
$ clear vm config schedule
$ vm launch kvm a
Error (server1): vm already queued with name `a`
$ vm launch kvm b
Error (server1): VM scheduled on unknown host: `doesnotexist`
$ ns add-hosts server2
$ vm config schedule server1,server2
$ vm config disk test.qcow2
$ vm launch kvm a
Error (server1): VM scheduled on unknown host: `server1,server2`
minimega:/tmp/minimega/minimega$ clear vm config schedule
minimega:/tmp/minimega/minimega$ vm launch kvm a
Error (server1): vm already queued with name `a`
minimega:/tmp/minimega/minimega$ vm launch kvm b
Error (server1): VM scheduled on unknown host: `server1,server2`

Expected behavior Warn on wildcarding not supported. Should be able to clear the vm config schedule name if you enter something invalid.

jcrussell commented 5 years ago

Specifying a wildcard doesn't make sense based on the API docs for vm config schedule.

We could warn or error if the host isn't part of the namespace though.

If you have queueing enabled, the VM config is already in the queue so you'll have to use ns flush to clear the queue.