Difference between revisions of "ESXi Stuff"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
Line 13: Line 13:


= ESXi from the Command Line =
= ESXi from the Command Line =
== Basic Concepts ==
* ESXi appears to be based on [https://www.busybox.net/ BusyBox]
** So...  If you're bashing your head against a wall trying to figure out how do do something low-level, check out the documentation for BusyBox.
** Basically tho...  Most of the functionality is very close to typical Linux, so the man pages on a Linux machine will get you very close.
==Usability Fixes==
ESXi has a '''NON-EDITABLE''' shell profile at '''/etc/profile'''.
Luckily, there's an override file at '''/etc/profile.local'''
After any changes you make to this file,
* <code>source /etc/profile.local</code>
enables your changes.
To make the changes persist over a restart of the server:
* <code>/sbin/auto-backup.sh</code>
To tell ESXi to save the changes.
===The Shell Prompt===
The shell prompt (when you're in a directory on a mounted volume) is fugly & useless.
* <code>vi /etc/profile.local</code>
PS1="[\u@\h \e[1;33m\W]\e[m\$ "
(My current preference...)
===PATH===
By default, the execution PATH is <code>/bin:/usr/bin</code> . This is fine if you don't want to add executables elsewhere.
I tend to put various utility scripts & such in sub-folders of '''/vmfs/volumes/Admin/Utilities'''
This can also be fixed in '''/etc/profile.local'''
* <code>vi /etc/profile.local</code>
PATH=/bin:/usr/bin:/vmfs/volumes/Admin/Utilities/Scripts:/vmfs/volumes/Admin/Utilities/ghettoVCB
export PATH
==== Caveat ====
Remote execution through SSH does not read the '''/etc/profile.local''' file.
One solution is to put your custom executables in the '''/bin''' folder.  '''<big>BUT</big>''', this is not maintainable.  It can break on reboot and will DEFINITELY break on upgrades.
A better solution is to put a symbolic link there.
eg.:
* <code>ln -s /vmfs/volumes/Admin/Utilities/Scripts/MyCustomCode.sh /bin</code>
= Older Notes (Mostly still on the TinkerNet Wiki) =
= Older Notes (Mostly still on the TinkerNet Wiki) =
[https://www.youtube.com/watch?v=KW1fRVgOoUU&list=PLS2odYzlaogI1B8ejt7itMOovAqpiLkvU Why virtualize your server infrastructure (Morton Hjorth)]
[https://www.youtube.com/watch?v=KW1fRVgOoUU&list=PLS2odYzlaogI1B8ejt7itMOovAqpiLkvU Why virtualize your server infrastructure (Morton Hjorth)]

Revision as of 14:45, 8 February 2022

WIP...

Installation

Setup

  • Laying out the Datastores
  • An "Admin" Datastore

Maintenance

ESXi from the Command Line

Basic Concepts

  • ESXi appears to be based on BusyBox
    • So... If you're bashing your head against a wall trying to figure out how do do something low-level, check out the documentation for BusyBox.
    • Basically tho... Most of the functionality is very close to typical Linux, so the man pages on a Linux machine will get you very close.

Usability Fixes

ESXi has a NON-EDITABLE shell profile at /etc/profile.

Luckily, there's an override file at /etc/profile.local

After any changes you make to this file,

  • source /etc/profile.local

enables your changes.

To make the changes persist over a restart of the server:

  • /sbin/auto-backup.sh

To tell ESXi to save the changes.

The Shell Prompt

The shell prompt (when you're in a directory on a mounted volume) is fugly & useless.

  • vi /etc/profile.local
PS1="[\u@\h \e[1;33m\W]\e[m\$ "

(My current preference...)

PATH

By default, the execution PATH is /bin:/usr/bin . This is fine if you don't want to add executables elsewhere.

I tend to put various utility scripts & such in sub-folders of /vmfs/volumes/Admin/Utilities

This can also be fixed in /etc/profile.local

  • vi /etc/profile.local
PATH=/bin:/usr/bin:/vmfs/volumes/Admin/Utilities/Scripts:/vmfs/volumes/Admin/Utilities/ghettoVCB
export PATH

Caveat

Remote execution through SSH does not read the /etc/profile.local file.

One solution is to put your custom executables in the /bin folder. BUT, this is not maintainable. It can break on reboot and will DEFINITELY break on upgrades.

A better solution is to put a symbolic link there.

eg.:

  • ln -s /vmfs/volumes/Admin/Utilities/Scripts/MyCustomCode.sh /bin

Older Notes (Mostly still on the TinkerNet Wiki)

Why virtualize your server infrastructure (Morton Hjorth)