qm stop [vmid]e.g.:
qm stop 124Check back in the GUI a few seconds later and you should see that the KVM has stopped.
Websites and SEO
qm stop [vmid]e.g.:
qm stop 124Check back in the GUI a few seconds later and you should see that the KVM has stopped.
timeout [no. of seconds] [command]e.g.
timeout 10 rsync /home/user/files/ /backups/user/files/would run the above rsync command but kill it after 10 seconds. This can be particularly useful with your daily scripts; simply set the timeout to be a few minutes less than 24 hours and you should hopefully avoid them running over each other. For reference there are 3600 seconds in an hour and 86400 seconds in 24 hours; setting a process to timeout after 86000 seconds would result in it running for 23 hours, 56 minutes and 20 seconds.
which lswill return:
/bin/lsNot everything will be in /bin, e.g.:
which timeoutwill likely return:
/usr/bin/timeoutSimple but it will make your life quite a bit easier when writing scripts, particularly with new commands or command which you don’t use often.
vim-cmd hostsvc/maintenance_mode_enterto go into maintenance mode – and to leave it:
vim-cmd hostsvc/maintenance_mode_exitIf you’re interested in other useful commands, you can see more hostsvc options by running:
vim-cmd hostsvcThis is a useful command to know as it is one of the critical steps in applying some patches to ESXi remotely.
vmware -vThis will display output along the lines of the following:
VMware ESXi 5.0.0 build-469512You can also use:
vmware -lwhich doesn’t display the build number:
VMware ESXi 5.0.0 GAStraightforward but very handy if you haven’t got the proper notes with you.
# zfs get all | grep compressratio backup01 compressratio 1.23x – backup01 refcompressratio 1.00x – backup01/data compressratio 1.50x – backup01/data refcompressratio 1.50x – backup01/photos compressratio 1.05x – backup01/photos refcompressratio 1.05x –Here we only really want to see the compressratio results, not the refcompressratio. We can pipe the grep output to another grep command, this time inverting the results with the -v switch.
# zfs get all | grep compressratio | grep -v refcompressratio backup01 compressratio 1.21x – backup01/data compressratio 1.50x – backup01/photos compressratio 1.05x –This excludes any line containing refcompressratio, making the results easier to read. This is particularly helpful when you have a large number of results from grep.