An all-CLI approach to starting/stopping VMs in ESXi 5.1

You could do that without vSphere client, you knew that?!?

Provided that SSH is enabled on ESXi (link opens another window), log in to the root prompt the follow the steps below:

  1. first, verify that the host is/isn’t in Maintenance mode:
    # vim-cmd hostsvc/hostsummary | grep Maintenance
    inMaintenanceMode = false,
  1. obviously, if it is, leave Maintenance mode:
    # vim-cmd hostsvc/maintenance_mode_exit
    'vim.Task:haTask-ha-host-vim.HostSystem.exitMaintenanceMode-xxx'
  1. then, check which VMs are available (output edited):
    # vim-cmd vmsvc/getallvms
    Vmid  Name               File                      Guest OS     Version
    1    name_1  [storage_1] Debian 64 6.x/vmx1.vmx  LinuxGuest     vmx-08
    2    name_2  [storage_2] Windows XP 1/vmx2.vmx   winXPProGuest  vmx-07
    3    name_3  [storage_3] Windows XP 2/vmx3.vmx   winXPProGuest  vmx-08 
  1. VMs can be started as follows:
    # vim-cmd vmsvc/power.on 2
    Powering on VM:

The opposite process, i.e. to shutdown the VMware server, is:

  1. gracefully shutdown the VMs one-by-one
  2. enter Maintenance mode:
    # vim-cmd hostsvc/maintenance_mode_enter
    'vim.Task:haTask-ha-host-vim.HostSystem.enterMaintenanceMode-yyy'
  3. shutdown services:
    # shutdown.sh
  4. power-off the server:
    # poweroff

Yep, that's all you have to do, no need for vSphere client for the time being :)

Links:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1038043

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=9639912

Start an Apache Web Server in Mac OS X Mountain Lion

In OS X Mountain Lion the Web Sharing preference panel has been removed. The Apache web server remains bundled with Mac OS X though, but you’ll need to turn to the command line to enable the web server.

  1. Create and edit the following file /etc/apache2/users/USERNAME.conf (replace “USERNAME” with the actual account)
  2. Its contents should be as follows:
    <Directory "/Users/USERNAME/Sites/">
    Options Indexes Multiviews
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    </Directory>
  3. start the actual server: sudo apachectl start
  4. accessing http://127.0.0.1/ will simply display It works!
  5. files stored under /Users/USERNAME/Sites/ will be accessible from http://127.0.0.1/~USERNAME
  6. stop/restart your Apache web server with sudo apachectl stop|restart

Source: http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/

More info here: http://reviews.cnet.com/8301-13727_7-57481978-263/how-to-enable-web-sharing-in-os-x-mountain-lion/

and here: http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion