Automated listing IPMI, CVM and Hypervisor IPs in CLI | Nutanix Community
Skip to main content

 Anecdote by @Kiran Surya 

 

Nutanix users and administrator are often required to access the CVMs, Hypervisors and IPMIs through their IP addresses.  The most commonly used method to look at the IP addresses of these three entities is through Prism Element, and going through the Hardware tabs.  However, looking through the GUI can be time consuming since you are required to click on every Host to view the IP address details of all three components.  It’s all the more cumbersome if you have a huge infrastructure, like say 24 Hosts.  It would be ideal if there is an easier process to list all these pieces of vital information.  

 

I happen to use the following combination of characters to list all these three pieces of data, and needless to say the customers are delighted when they see me run this command:


 

nutanix@NTNX-7B43JB2-A-CVM:10.171.154.127:~$

nutanix@NTNX-7B43JB2-A-CVM:10.171.154.127:~$ echo; set `ncli host list | grep Address | sed 's/^.*: //'`;echo -e "    IPMI\t    CVM\t\tHypervisor";echo -e "    ----            ---         ----------";c=0;for f in $@;do echo -ne "$f\t";((c = c + 1));if o $((c%3)) -eq 0 ];then echo;fi;done; echo; echo

 

    IPMI            CVM         Hypervisor

    ----            ---         ----------

10.171.154.113  10.171.154.112  10.171.154.111

10.171.154.116  10.171.154.115  10.171.154.114

10.171.154.119  10.171.154.118  10.171.154.117

10.171.154.122  10.171.154.121  10.171.154.120

10.171.154.125  10.171.154.124  10.171.154.123

10.171.154.128  10.171.154.127  10.171.154.126

10.171.154.131  10.171.154.130  10.171.154.129

10.171.154.134  10.171.154.133  10.171.154.132

10.171.154.137  10.171.154.136  10.171.154.135

10.171.154.140  10.171.154.139  10.171.154.138

10.171.154.143  10.171.154.142  10.171.154.141

10.171.154.146  10.171.154.145  10.171.154.144

10.171.154.149  10.171.154.148  10.171.154.147

10.171.154.152  10.171.154.151  10.171.154.150

10.171.154.155  10.171.154.154  10.171.154.153

10.171.154.158  10.171.154.157  10.171.154.156

10.171.154.161  10.171.154.160  10.171.154.159

10.171.154.164  10.171.154.163  10.171.154.162

10.171.154.167  10.171.154.166  10.171.154.165

10.171.154.170  10.171.154.169  10.171.154.168

 

nutanix@NTNX-7B43JB2-A-CVM:10.171.154.127:~$

nutanix@NTNX-7B43JB2-A-CVM:10.171.154.127:~$

 

The above command essentially parses through the often used $ncli host list  command output, handpicks the IP addresses from each Host and lists them as shown above.  This comes in especially handy when a customer is working with a Nutanix Technical Support engineer and they are trying to figure out the individual pieces of a Host while doing a hardware replacement like DIMM, or if they are trying to submit a report to the upper Management on the resources being used.

 

Hope you get this command the next time you work at the CLI on your Nutanix cluster infrastructure.