Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
list Openstack Rackspace cloud servers ip in more readable way
nova list | egrep -v 'ID|-----' | awk -F'|' '{print $2 }' | ( echo 'name pub-new(rc) ip priv-net ip init-net ip' ; while read cs; do nova show $cs | egrep ' name |accessIPv4|public network|private' | awk -F"|" '{for (i=1;i<=NF;i++) gsub (/^ */,"",$i); print $2,$3}' | sort | xargs echo | awk ' { print $4,$1,$2,$5,$6,$7,$8 }'; done ) | column -t
name pub-new(rc) ip priv-net ip init-net ip
APP01 accessIPv4 privatenetwork publicnetwork 1111:1a11:1111:2222:3333:2222:ff08:a1ce,
APP01 accessIPv4 privatenetwork publicnetwork,1111:2222:3333:4444:5555:ae11:ff08:70b5
APP02 accessIPv4 privatenetwork publicnetwork,1111:2222:3333:4444:5555:ae11:ff08:9586
APP03 accessIPv4 privatenetwork publicnetwork,1111:2222:3333:4444:5555:ae11:ff08:1300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment