Tag: vmware

  • How to restart management agents on ESX or ESXi host

    How to restart management agents on ESX or ESXi host

    If you are not unable to connect ESXi server to vCenter, or when you cannot connect to ESXi server from VI client it may be necessary to restart the management agents on ESX or ESXi host.

    To restart the management agents on ESXi 6.x

    This applies to ESX4/5.x/6.x

    For the restart of the management agents (mgmt-vmware and vmware-vpxa) do the following:

    Log in to SSH or Local console as root.
    Run these commands:

    /etc/init.d/hostd restart
    /etc/init.d/vpxa restart

    Or also (alternative way)
    To reset the management network on a specific VMkernel interface, by default vmk0, run the command:

    esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0

    [su_note note_color=”#fafae8″]Note: Using a semicolon (;) between the two commands ensures the VMkernel interface is disabled and then re-enabled in succession. If the management interface is not running on vmk0, change the above command according to the VMkernel interface used.[/su_note]

    to restart all management agents on the host, run the command:

    services.sh restart

    To restart the Management agents on ESXi Server – via the console:

    1.) Connect to the console of your ESX Server and press F2
    2.) Login as root and when using the Up/Down arrows navigate to Restart Management Agents.
    3.) Press Enter and press F11 to restart the services.
    4.) When the service has been restarted, press Enter. Then you can press Esc to logout of the system.

    Screen should be similar to:

    To restart the management agents on ESXi 4.x and 5.x:

    From Local Console or SSH:
    1. Log in to SSH or Local console as root.
    2. Run this command:
    /sbin/services.sh restart

    You can also check:  Service mgmt-vmware restart may not restart hostd (1005566).

    To restart the management agents on ESX Server 3.x, ESX 4.x:

    1. Login to your ESX Server as root from SSH session or directly from the console.
    2. Type service mgmt-vmware restart  and press Enter
      Make sure that automatic Startup/Shutdown of virtual machines is disabled before running this command otherwise you might reboot the virtual machines. See more at 103312
    3. Type service vmware-vpxa restart and press Enter.
    4. Type logout and press Enter to disconnect from the ESX Server.

    Successful output :

    Stopping vmware-vpxa: [ OK ]
    Starting vmware-vpxa: [ OK ]

    This may also server as a solution for the error “Unable to access file since it is locked. An error occurred while consolidating disks: One or more disks are busy.”

  • VMware: Intermittent Error: Unexpected character ‘’ (code 65279 / 0xfeff) in prolog; expected ‘<' at [row,col {unknown-source}]: [1,1] pop up in Windows vSphere client ?

    Recently, I got the error below when using the vSphere client.

    Problem:

    error

    I have only tested this solution on:

    2016-10-04_11-41-47

    Solution:

    Repair your installation of Microsoft Visual J#® 2.0 Redistributable Package – Second Edition (x64)

    Download

    The error went away after repair.

    In trying to google the error some user have reported that uninstall the patch KB3147458 worked for them. I didn’t have the patch.

     wusa.exe /uninstall /KB:3142024

    Hope this helps.

  • ESXi 6.0 not detecting BROCADE HBA adapter

    Steps:

    1. Make sure HBA is connected on the PCI slot and visible under esx hardware list:
      esxcli hardware pci list
    2. Check if VMKernel can detect any storage via Fibre Channel
      esxcli storage san fc list

      (output will be blank line if HBA driver is missing but HBA appears to be in PCI card determined from step 1)

      esxcli storage core adapter rescan
    3. Search and download the relevant ESXi drivers for HBAthe recommended driver (bfa) version for 82B in ESXi 5.1 is 3.0.0.0
      You can download it from the following URL.
      https://my.vmware.com/web/vmware/details?downloadGroup=DT-ESXi50-BROCADE-bfa-3000&productId=229
    4. Download the driver and install it using following instructions:

    New Installation

    For new installs, you should perform the following steps:

    1. Copy the VIB to the ESX server.  Technically, you can place the file anywhere that is accessible to the ESX console shell, but for these instructions, we’ll assume the location is in ‘/tmp’. Here’s an example of using the Linux ‘scp’ utility to copy the file from a local system to an ESX server located at 10.10.10.10:
      scp VMware_bootbank_net-driver.1.1.0-1vmw.0.0.372183.vib [email protected]:/tmp
    2. Issue the following command (full path to the VIB must be specified):
      esxcli software vib install -v {VIBFILE}

    In the example above, this would be:

    esxcli software vib install -v /tmp/VMware_bootbank_net-driver.1.1.0-1vmw.0.0.372183.vib

    Note: Depending on the certificate used to sign the VIB, you may need to change the host acceptance level.  To do this, use the following command:

    esxcli software acceptance set --level=<level>

    Also, depending on the type of VIB being installed, you may have to put ESX into maintenance mode.  This can be done through the VI Client, or by adding the ‘–maintenance-mode’ option to the above esxcli command.

    Upgrade Installation

    The upgrade process is similar to a new install, except the command that should be issued is the following:

    esxcli software vib upgrade -v {VIBFILE}

    Reboot host.

    Now you should have the HBA should the datastores.

  • Remove licensing from ESXi host

    WARNING: This is for education/informational testing/development purposes only, and should not be used on a production server.

    WARNING: This trick will only work with an ESX(i) stand alone server.  It will not work if the ESX(i) server is connected to a vCenter Server, as the vCenter Server knows better than to let you do this.  (you can always remove and readd the ESX(i) server to vCenter.)

    To reset your ESX 4.x, ESXi 4.x and ESXi 5.x 60 day evaluation license:

    1. Login to the TSM through SSH or Shell
    2. Remove the following two files:
      1. /etc/vmware/vmware.lic
      2. /etc/vmware/license.cfg
    3. Reboot server

    If your ESX server is connected to a vCenter server, please remove the ESX server first.  Once the steps above are completed, you can add it back to the vCenter server.

    Command to remove the license and reboot the ESX host:

    rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
    reboot

    After reboot, logging on the ESXi server, you should be greeted with this message.

    60-day-evaluation

    For ESXi 5.1 and ESXi 5.5, you may need to continually remove the license files as the server reboots for this to work.  The following should do this quite nicely:

    rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
    reboot ; while true ; do
        rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
    done

    An alternative would be restarting the services, it should work just as well as rebooting the server:

    # For ESXi 5.0
    rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
    services.sh restart
    # For ESXi 5.1
    rm -r /etc/vmware/license.cfg
    cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg
    /etc/init.d/vpxa restart

    For vCenter
    1) Create a DSN to your local SQL Express instance that holds your vCenter DB.
    2) Uninstall virtual center
    3) Re-install virtual center and point to your DSN making sure not to overwrite.

    With this method, I have been able to refresh my 4.1 and 5.0 hosts.  Have not confirmed if this works for 5.1.

  • How to Install VMware Tools on RHEL 7/CentOS 7

    VMware Tools is one of important components for virtual machine (VM) in order get excellent performance. It is a group of utilities that help to enhances the overall performance of the virtual machine’s guest operating system (OS) and improves management of the VM. Without the VMware Tools, guest OS performance will lacks some of the important functionality. Below steps shows how to install the VMware Tools on RHEL 7, CentOS 7 and Oracle Linux 7.

    How to Install VMware Tools ?

    Option 1 (Recommended by VMware) – VMware support of open-vm-tools

    open-vm-tools is an open source implementation of VMware Tools from third parties and contains utilities that enhances virtualization management, administration and functions of the virtual machine in VMware environments. The ultimate goal is to enable the operating system vendors and/or communities and virtual appliance vendors to bundle VMware Tools into their product releases.

    # yum install open-vm-tools
    

    Option 2 :

    1. Install prerequisites :

    # yum install perl gcc make kernel-headers kernel-devel -y
    

    2. Attach the vmware tools sofware from vSphere client.

    3. Mount the vmware tools package into /mnt :

    # <strong>mount /dev/cdrom /mnt</strong>
    mount: /dev/sr0 is write-protected, mounting read-only
    

    4. Copy vmware tool packagae into /tmp :

    # cd /mnt
    
    # ls
    manifest.txt     VMwareTools-9.4.0-1280544.tar.gz  vmware-tools-upgrader-64
    run_upgrader.sh  vmware-tools-upgrader-32
    # <strong>cp -p VMwareTools-9.4.0-1280544.tar.gz /tmp
    </strong>

    5. Go to /tmp directory and extract the vmware tools package :

    # cd /tmp
    # <strong>tar xzvf VMwareTools-9.4.0-1280544.tar.gz
    </strong>

    6. Go to extracted folder, vmware-tools-distrib :

    # <strong>cd vmware-tools-distrib</strong>
    # ls
    bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl
    

    7. Run vmware-install.pl to start installation :

    # <strong>./vmware-install.pl</strong>
    

    Example:

    # ./vmware-install.pl
    Creating a new VMware Tools installer database using the tar4 format.
    
    Installing VMware Tools.
    
    In which directory do you want to install the binary files?
    [/usr/bin]
    
    What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
    [/etc/rc.d]
    
    What is the directory that contains the init scripts?
    [/etc/rc.d/init.d]
    
    In which directory do you want to install the daemon files?
    [/usr/sbin]
    
    In which directory do you want to install the library files?
    [/usr/lib/vmware-tools]
    
    The path "/usr/lib/vmware-tools" does not exist currently. This program is
    going to create it, including needed parent directories. Is this what you want?
    [yes]
    
    In which directory do you want to install the documentation files?
    [/usr/share/doc/vmware-tools]
    
    The path "/usr/share/doc/vmware-tools" does not exist currently. This program
    is going to create it, including needed parent directories. Is this what you
    want? [yes]
    
    The installation of VMware Tools 9.4.0 build-1280544 for Linux completed
    successfully. You can decide to remove this software from your system at any
    time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
    
    Before running VMware Tools for the first time, you need to configure it by
    invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
    this program to invoke the command for you now? [yes]
    
    Initializing...
    
    
    Making sure services for VMware Tools are stopped.
    
    Stopping vmware-tools (via systemctl):                     [  OK  ]
    
    
    The module vmci has already been installed on this system by another installer
    or package and will not be modified by this installer.
    
    The module vsock has already been installed on this system by another installer
    or package and will not be modified by this installer.
    
    The module vmxnet3 has already been installed on this system by another
    installer or package and will not be modified by this installer.
    
    The module pvscsi has already been installed on this system by another
    installer or package and will not be modified by this installer.
    
    The module vmmemctl has already been installed on this system by another
    installer or package and will not be modified by this installer.
    
    The VMware Host-Guest Filesystem allows for shared folders between the host OS
    and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
    to enable this feature? [no]
    
    The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
    upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)
    
    The vmblock enables dragging or copying files between host and guest in a
    Fusion or Workstation virtual environment.  Do you wish to enable this feature?
    [no]
    
    VMware automatic kernel modules enables automatic building and installation of
    VMware kernel modules at boot that are not already present. This feature can be
    
    enabled/disabled by re-running vmware-config-tools.pl.
    
    Would you like to enable VMware automatic kernel modules?
    [no]
    
    No X install found.
    
    Creating a new initrd boot image for the kernel.
    Starting vmware-tools (via systemctl):                     [  OK  ]
    The configuration of VMware Tools 9.4.0 build-1280544 for Linux for this
    running kernel completed successfully.
    
    You must restart your X session before any mouse or graphics changes take
    effect.
    
    You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
    command line.
    
    To enable advanced X features (e.g., guest resolution fit, drag and drop, and
    file and text copy/paste), you will need to do one (or more) of the following:
    1. Manually start /usr/bin/vmware-user
    2. Log out and log back into your desktop session; and,
    3. Restart your X session.
    
    Enjoy,
    
    --the VMware team
    

    8. Once successfully installed, make sure you umount (not unmount- missing the n) back the /mnt :

    # umount /mnt