Jason Davis1709157056 Posted December 8, 2021 Share Posted December 8, 2021 I'm trying to pull out a list of certain VMs using xe vm-list, by the uuid of each. Is there a way to search multiple uuids in the same command? I've tried all sorts of iterations with no luck: xe vm-list uuid="abc123,def456" xe vm-list uuid=abc123 + def456 (etc, etc.) Thanks in advance. Link to comment
0 Tobias Kreidl Posted December 9, 2021 Share Posted December 9, 2021 No wildcard support in that xe command. You could just do an "xe vm-list params=uuid" and pipe the output to some form of grep to isolate certain UUIDs using egrep wildcard syntax, for example. -=Tobias Link to comment
0 Sergey Polyakov Posted December 12, 2021 Share Posted December 12, 2021 VMS=`xe vm-list | grep -E 'a40a|0146' | awk '{print $5}'` for VMSU in $VMS do xe vm-list uuid=$VMSU done Result: uuid ( RO) : 2a698fe1-a40a-3295-92a1-67d1662604ac name-label ( RW): PC1 power-state ( RO): halted uuid ( RO) : b0b5b91e-0146-19ac-f8ab-8ea2450a6c31 name-label ( RW): PC2 power-state ( RO): halted Link to comment
Question
Jason Davis1709157056
I'm trying to pull out a list of certain VMs using xe vm-list, by the uuid of each. Is there a way to search multiple uuids in the same command? I've tried all sorts of iterations with no luck:
xe vm-list uuid="abc123,def456"
xe vm-list uuid=abc123 + def456 (etc, etc.)
Thanks in advance.
Link to comment
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now