TritonDataCenter / smartos-live

For more information, please see http://smartos.org/ For any questions that aren't answered there, please join the SmartOS discussion list: https://smartos.topicbox.com/groups/smartos-discuss
1.57k stars 245 forks source link

`vmadm list` returns nothing when passed an argument #41

Closed bdha closed 12 years ago

bdha commented 12 years ago

It appears to pull info for all zones, and then returns nothing:

# time vmadm list
UUID                                  TYPE  RAM      STATE             ALIAS 
10bc0b4a-8df4-4808-8b7c-96b19ff5dbcb  KVM   1024     running           analysis0
21e72bde-c61e-4748-90e0-8281f4e8007f  KVM   1024     running           process1
409e2214-1a40-429c-9404-039c135170c1  KVM   1024     running           analysis2
508bf6c8-f899-4924-a16f-15dd10a80211  KVM   1024     running           process2
97808650-ba5b-48fb-860d-a2624ce3afe3  KVM   1024     running           analysis1
1c8d924d-9d70-40b4-bcb2-4b3a7e318cd4  OS    2048     running           sprawlmq-int
ce3a4d67-9a61-4bb1-a520-a79131181f2c  KVM   8192     running           control1-int
a9d64ca3-a155-4e83-90a7-ea9a65179d8c  OS    16384    running           demoimport1-int
492add60-13cc-4239-a4c6-a6a561251416  OS    -        running           clouddb3
828dd430-979d-498f-abc1-a6583e90454a  OS    -        running           cleanroom
d755787d-6b1c-4027-a4a6-7c5e2a962f8f  OS    -        running           clouddb3

real    0m15.211s
user    0m3.602s
sys     0m5.896s

# time vmadm list a9d64ca3-a155-4e83-90a7-ea9a65179d8c
UUID                                  TYPE  RAM      STATE             ALIAS 

real    0m14.612s
user    0m3.738s
sys     0m5.945s
joshwilsdon commented 12 years ago

The reason this happens is that parameters after the list are treated as filter options (per the man page). This allows you to do for example:

vmadm list ram=1024

or:

vmadm list ram=1024 type=KVM alias=~^process

but in this case the filter parameter is unrecognized. I will fix this so that unrecognized filter options result in an error message.

bdha commented 12 years ago

aha! I did not know about the man page. That is exciting. :-)

joshwilsdon commented 12 years ago

This has been fixed in the latest release, now you'll get:

[root@00-0c-29-7e-a5-32 ~]# vmadm list a1965714-5f1f-11e1-803d-df447dd8ec95
Invalid filter key: "a1965714-5f1f-11e1-803d-df447dd8ec95"
[root@00-0c-29-7e-a5-32 ~]# 

so that you'll know what's wrong at least.