top of page

Simple but useful commands

Writer: Marco TubbenMarco Tubben

Updated: Jan 12, 2023

Show mounted iso in VM


for i in `acli vm.list |cut -d " " -f 1`; do if [ -n "`acli vm.get $i | grep -A1 cdrom | grep container`" ] ; then echo $i ; fi ; done

 

Show started VM's


acli vm.list power_state=on

 

Show Installed Nutanix Guest Tools


ncli ngt list vm-names=<VM-Name>

ncli ngt list | grep -B6 "Active : false"

 

Set VM Affinity


vm.affinity_set vm1,vm2,vm3 host_list="fqdn_nkode1,fqdn_node2"

 

Change RF factor


ncli ctr edit rf=3 id=xx force=true

 

Show Upgrade history


~ /config$ cat /home/nutanix/config/upgrade.history

 

Control Time Drift


$ allssh '(/usr/bin/crontab -l && echo "*/1 * * * * bash -lc /home/nutanix/serviceability/bin/fix_time_drift") | /usr/bin/crontab -'

The script begins to gradually synchronize the time backwards. Lab tests show that time is synchronized backwards, until the clock is completely in synchronization with the external time source.

Display the progress of the time synchronization by using the following command.

$ allssh grep offset ~/data/logs/genesis.out

Turn off the time synchronization script after the time synchronization is complete by using the following command.

$ allssh "(/usr/bin/crontab -l | sed '/fix_time_drift/d' | /usr/bin/crontab -)"

 

view services not up


cluster status | grep -v UP

 

find prism leader

curl localhost:2019/prism/leader

 

check if foundation is running

allssh 'genesis status | grep foundation'

stop foundation :

genesis stop foundation

./foundation/bin/foundation_service {start|stop|restart|status}

 

check foundation version(s)


(allssh) cat ~ /foundation/foundation_version

 

Check genesis logfiles


tail -f ~/data/logs/genesis.outtail -f

 

exit Phoenix:


python /phoenix/reboot_to_host.py

 

Speed up WINSCP


before start session : Connection -> deselect "optimize connection buffer size"

 

reset ESXi root password


ssh root@192.168.5.1

pam_tally2 --user root --reset

 



 
 
 

Comments


MarcosTips

©2022 by MarcosTips. Proudly created with Wix.com

bottom of page