어떤 vm을 누가 만들었는지 찾기 귀찮아서…

$ cat get_user_from_ip.sh
#!/bin/bash
ip=$1

port_id=$(quantum port-list | grep $ip | awk '{print $2}')
device_id=$(quantum port-show $port_id | awk '/device_id/{print $4}')
user_id=$(nova show $device_id | awk '/user_id/{print $4}')
keystone user-get $user_id

$ ./get_user_from_ip.sh x.x.x.x

Leave a Reply

Your email address will not be published. Required fields are marked *