Archive

Archive for the ‘VMWare’ Category

Latest VMWare ESXi 6 on Intel Nuc

April 30th, 2016 No comments
  1. Download and install VMWare vSphere PowerCLI.
    At the moment that I’m writing is version 6.3 Release 1.
  2. Open PowerCLI
  3. Add VMWare official repository
    Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
  4. Search for the latest version.
    First I tried by sorting by ModifiedTime but many were modified the same day
    PowerCLI C:\> Get-EsxImageProfile -Name "ESXi-6.*" | Sort-Object "ModifiedTime"
    -Descending | format-table -property Name,CreationTimeName                                    CreationTime
    ----                                    ------------
    ESXi-6.0.0-20151104001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160104001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20160104001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160302001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160302001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150704001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20160101001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20150504001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20150704001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160204001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150504001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150404001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20160204001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20151104001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150404001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20150701001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20150902001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20160301001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20150902001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160301001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20160101001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20150901001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20150701001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20151004001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150901001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20151004001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-2494585-no-tools             06/02/2015 02:37:25
    ESXi-6.0.0-2494585-standard             06/02/2015 02:37:25

    Then I decided to sort by Name instead.
    PowerCLI C:\> Get-EsxImageProfile -Name "ESXi-6.*" | Sort-Object "Name" -Descend
    ing | format-table -property Name,CreationTimeName                                    CreationTime
    ----                                    ------------
    ESXi-6.0.0-2494585-standard             06/02/2015 02:37:25
    ESXi-6.0.0-2494585-no-tools             06/02/2015 02:37:25
    ESXi-6.0.0-20160302001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160302001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20160301001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20160301001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20160204001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160204001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20160104001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20160104001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20160101001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20160101001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20151104001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20151104001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20151004001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20151004001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150902001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20150902001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150901001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20150901001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20150704001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20150704001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150701001s-standard        04/03/2016 03:31:22
    ESXi-6.0.0-20150701001s-no-tools        04/03/2016 03:31:22
    ESXi-6.0.0-20150504001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20150504001-no-tools         04/03/2016 03:31:22
    ESXi-6.0.0-20150404001-standard         04/03/2016 03:31:22
    ESXi-6.0.0-20150404001-no-tools         04/03/2016 03:31:22

    So in my case I took ESXi-6.0.0-20160302001-standard
  5. Clone the profile
    New-EsxImageProfile -CloneProfile "ESXi-6.0.0-20160302001-standard" -name "ESXi-6.0.0-20160302001-standard-NUC” -Vendor "virten.net" -AcceptanceLevel "CommunitySupported"
  6. Add the following repository
    Add-EsxSoftwareDepot http://vibsdepot.v-front.de
  7. Add the sata-xahci package
    Add-EsxSoftwarePackage -ImageProfile "ESXi-6.0.0-20160302001-standard-NUC" -SoftwarePackage "sata-xahci"
  8. Export the image
    Export-ESXImageProfile -ImageProfile "ESXi-6.0.0-20160302001-standard-NUC" -ExportToISO -filepath ESXi-6.0.0-20160302001-standard-NUC.iso
  9. Create a bootable USB disk using Rufus
  10. Enjoy 🙂

 

SOURCE: ESXi 6.0 Image for Intel NUC

Categories: VMWare Tags: , ,

Use the Virtual Network Editor in VMware Player 7

October 7th, 2015 No comments

On VMware Player you don’t have the Virtual Network Editor which is available in VMware Workstation.

To have it in VMware Player 7, you can take it from the VMware Workstation 11 installation package. It will not work if you use VMware Workstation 12.

Open a prompt command, go to the directory where you have the installation package and extract the content with

[cce]VMware-workstation-full-12.0.0-2985596.exe /extract .\vmware[/cce]

All files will be extracted into a vmware directory.
Inside here you will find a package called vmwareworkstation.msi.Extract it using 7-Zip. Enter the extracted directory and extract Core.cab.
Go inside the extract directory and you will find vmnetcfg.exe
Now copy this file into your VMware Player diretory, like

[cce]C:\Program Files (x86)\VMware\VMware Player[/cce]

Now you can open it and edit your interfaces.

 

SOURCE: How to add Virtual Network Editor to VMware Player, [2], [3]

How-To: script to shutdown ESXi Free via an USB UPS monitoring tool

April 7th, 2011 3 comments

Introduction

The purpose of this How-To is to let an USB UPS (in my case an APC Back-UPS 800VA) communicate to ESXi to shutdown or suspend VMs and then shutdown host in case of power failure.
The source script’s author is helux where if you can find the original thread and the original script in the sources links at the bottom of this article.
I have customized the script with a logging system and with an option to decide if to suspend or shutdown the virtual machines.

 

The problem

Due to the fact that, since VMWare ESXi 3.5U4, read and write access from RCLI (Remote Command Line Interface) has been disabled, we are unable to use scripts like ghettoUPSHostShutdown.pl written by lamw (William Lam).
Our only possibility is to install the USB UPS monitoring tool in a Virtual Machine, then communicate to ESXi via SSH and then run a script copied on the ESXi itself.

In my case I have an Ubuntu Server 10.10 installed as a Virtual Machine. Here I have installed apcupsd software to monitor the UPS.

 

Create ssh keys

I have generated an SSH key for root to let the VM communicate with ESXi.

[cce_bash]sudo ssh-keygen[/cce]

Do not set a passphrase for the private key otherwise we can’t automate the process.
After having enable the SSH server in ESXi, transfer the public key of the VM to ESXi

[cce_bash]sudo ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.0.100[/cce]

Change the path to the public key file and the IP address of the ESXi.

 

The script

Download the script with wget in your linux VM or copy and paste the content in a new document

powerdown-esxi4.x_v0.5

Edit the script and, at the beginning, customize it on your needs, such as enable logging system, set the log file, decide what VMs should do (suspend, shutdown) etc.

[cce_bash]# Set here if you want to suspend or shutdown the Virtual Machines
# Options available: suspend ; shutdown
VM_STATE=suspend

# To enable logging, set the following variable to 1
LOG_ENABLED=1
LOG_FILE=/vmfs/volumes/4c55e39f-3d85baef-7253-e0cb4e42250b/powerdown-esxi4.log[/cce]

Then transfer powerdown_esxi4. to ESXi

[cce_bash]scp powerdown_esxi4.1_v0.4.sh root@192.168.0.100:/bin[/cce]

Please note that if you transfer a text/script file from Windows via vSphere Client to a datastore, a line feed “^M” will be added so the file will be unusable.
If you want you can wget it.
Now login into your ESXi server and make powerdown_esxi4.sh executable

[cce_bash]chmod +x /bin/powerdown_esxi4.1_v0.4.sh[/cce]

 

Change UPS monitor software behaviour

We have to tell our UPS monitor software that during the Shutdown Sequence he has to run our script.

Network UPS Tools

Edit /etc/nut/upsmon.conf, change the line

[cce_bash]SHUTDOWNCMD "/sbin/shutdown -h +0"[/cce]

and call a custom script instead

[cce_bash]SHUTDOWNCMD "/usr/local/bin/nut-shutdown.sh"[/cce]

Create the script /usr/local/bin/nut-shutdown.sh

[cce_bash]#!/bin/sh
ssh root@192.168.0.100 ‘powerdown-esxi4.sh'[/cce]

The problem with Network UPS Tools and my APC UPS

I encountered 2 problems using my APC UPS:
1) NUT can’t power on my APC after power outage
2) My APC has ups.delay.shutdown= 20
That means that the amount of time the UPS will wait before shutting down is only 20s. I saw that I need at least 1:10 min, so I had to change it to 90s.
I did it with

[cce_bash]sudo upsrw -s ups.delay.shutdown=90 -u local_mon -p mypass apc@localhost[/cce]

but after a service restart, the UPS loses this setting.

apcupsd

Edit /etc/apcupsd/apccontrol this way

[cce_bash]doshutdown)
echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
ssh root@192.168.0.100 'powerdown_esxi4.1_v0.4.sh'
${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
;;[/cce]

The problem with apcupsd and my APC UPS

As stated in 2 thread in VMWare Communities:
ESXi-4.1: USB passthrough problem with APC Back-UPS CS 650
apcaccess: status output minimal when using USB device passthru on ESX

There is a problem in the USB passthrough of APC UPSes: apcupsd doesn’t recognize many parameters.
However essential parameters like LOADPCT (Percent Load Capacity), BCHARGE (battery charge), TIMELEFT, MBATTCHG (Minimum Battery Charge), MINTIMEL (Minimum Time Left) are properly recognized so we can continue using our script.
At the moment it is the best solution I have found.

 

Compress everything and generate oem.tgz

To load the ssh key and the script at system boot, you have to add it to /bootbank/oem.tgz, as ESXi will clear everything that doesn’t belong to the system itself.
If you don’t have any oem.tgz, create it with

[cce_bash]tar -cvzf /bootbank/oem.tgz .ssh/ /bin/powerdown_esxi4.1_v0.4.sh[/cce]

If you have already an oem.tgz for something else, extract the content to a folder, as the tar installed in ESXi doesn’t support appending of files,

[cce_bash]mkdir oem
tar -xvzf oem.tgz -C oem/[/cce]

copy the script preserving the directory structure of /bin

[cce_bash]mkdir /bootbank/oem/bin/
cp /bin/powerdown_esxi4.1_v0.4.sh /bootbank/oem/bin/[/cce]

copy also the ssh key

[cce_bash]cp -R /.ssh/ /bootbank/oem/[/cce]

compress again the archive

[cce_bash]cd /bootbank/oem/
tar -cvzf /bootbank/oem.tgz `ls -A`[/cce]

Enjoy :)

 

 

SOURCES:
VMWare /etc – ESXi U4 Ends Free Version Read and Write Access from the RCLI

VMWare Communities: esxi shutdown script for ups monitoring by helux

VMWare Communities: ghettoUPSHostShutdown.pl

vuemuer.it – Spegnere ESXi tramite un UPS APC

Categories: VMWare Tags: , , ,

VMWare Server: guests power on hangs at 95%

March 28th, 2011 1 comment

Host: Ubuntu Server 10.10 Maverick Meerkat
VMWare Server 2.0.2

If the host shut down unexpectedly, then it is possibile that you can’t start guests, hanging at 95% during startup process.
To solve, you need to:

  1. delete .lck file from the virtual machine’s folder
  2. delete file /etc/vmware/not_configured

Enjoy :)

SOURCE:
Zenware – VMware won’t boot after reboot: A general system error ocurred 95% boot and Stuff!

Categories: VMWare Tags: