Showing posts with label ESXi. Show all posts
Showing posts with label ESXi. Show all posts

Tuesday, March 07, 2017

How to install a HPE CPxxxxxx.scexe firmware update on your ESXi Host

Follow the steps below to make it happen:
(The most common reason for failure is caused by the missing executable permission)
  • Enable SSH on your ESXi host (configuration tab, Security Profile, Properties)
  • Copy the CPxxxxxx.scexe file to /tmp on your ESXi Host using eg. WinSCP
  • Logon as root at your ESXi host and change to /tmp
  • Check with “ls” if your CP file is there
  • Change file permission to executable: “chmod +x CPxxxxxx.scexe”
  • Run the file: “./CPxxxxxx.scexe”
After you have completed these steps, reboot the host and you are done.


Good luck!

Monday, September 19, 2016

ESXi 6 - The Primary GPT table states that the backup GPT is located beyond the end of the disk

I was attempting to reinstall ESXi 6.0 on a server that had a previous datastore on a RAID 5 array.  The array was missing a disk so I destroyed and recreated the array minus the missing disk and decided to just do without the storage of the one disk.

When I attempted to add the array into my fresh ESXi 6 load I got this error:

Call "HostDatastoreSystem.QueryVmfsDatastoreCreateOptions" for object "ha-datastoresystem" on ESXi "xxx.xx.xxx.xxx" failed

Not knowing how to fix this I did some research and found out a quick and easy repair.

1. Enable SSH on the VMware host.
2. Connect and run "ls -lha /vmfs/devices/disks" and this will list your disks with their disk ID.
3. Run the following command on the disk "partedUtil getptbl /vmfs/devices/disks/naa.5000c501234597a333"

This will return the following output if you have chosen the correct disk:

Error: The primary GPT table states that the backup GPT is located beyond the end of disk. This may happen if the disk has shrunk or partition table is corrupted. Fix, by writing backup table at the end? This will also fix the last usable sector appropriately as per the new reduced size. diskPath (/dev/disks/naa.5000c501234597a333) diskSize (286748000) AlternateLBA (570310655) LastUsableLBA (570310622)
Warning: The available space to /dev/disks/naa.5000c501234597a333 appears to have shrunk. This may happen if the disk size has reduced. The space has been reduced by (283562656 blocks). You can fix the GPT to correct the available space or continue with the current settings ? This will also move the backup table at the end if it is not at the end already. diskSize (286748000) AlternateLBA (570310655) LastUsableLBA (570310622) NewLastUsableLBA (286747966)
Error: Can’t have a partition outside the disk!
Unable to read partition table for device /vmfs/devices/disks/naa.5000c501234597a333

Apparently deleting the RAID array didn't fully erase all of the previous partition information.  Now it needs to be cleared manually.

4. Run the following to clear it:  "partedUtil setptbl /vmfs/devices/disks/naa.5000c501234597a333"

That's all there is to it.  By creating a msdos partition on the disk it will clear the previous error and allow esxi to create a datastore there with no errors.

Good luck!


















This is ve

Friday, June 26, 2015

Backup and Restore ESXi Host Configuration

Today's post involves something I haven't done before which is backing up and then restoring an ESXi hosts's configuration.  

In my examples today I am going to use the tools directly built into ESXi and vSphere to get this done.  I'm going to use PowerCLI 5.5 (latest version as of this writing) to get this done.

PowerCLI is one of the many tools that are bundled for free with the vSphere environment.  I highly recommend you have it installed on your management server or workstation and if you're running vCenter on Windows it's even better to place it there.  You can download PowerCLI from the VMware website.

The process of backing up and restoring the configuration is pretty simple so here we go.

Before running any of these commands you should run this command in PowerShell on Windows to make sure PowerCLI has the ability to execute the commands needed for this process to work.

Set-ExecutionPolicy RemoteSigned

Open PowerCLI and use the Connect-VIServer IPAddress command to connect to the server.

Next run the command below to backup your host's configuration.  Make sure you create the backup location folder before you run the command.

Get-VMHostFirmware -VMHost ESXi_host_IP_Address -BackupConfiguration -DestinationPath “Output_Directory”

When the process completes you'll have files that look like this:


That's all there is to backing up the configuration of your ESXi host.  Now for the really cool part.  
If you're upgrading hosts to new hardware there a couple of things I've done and the restore has went off without a hitch.  Make sure you have the VMware install on the new host at the exact same version as the host you backed up.  If not this isn't a supported process but you can use the "-force" command at the end of the restore to make it do it anyway.  The next thing is to ensure you have the network cables in the exact same port numbers as the old host.  In other words port 0 on the old host should get the cable for port 0 on the new.
If you're unsure which cables correspond to which port, once you've migrated all VMs off of the old host you can look at the network configuration in the vSphere client and pull the cables one at a time.  From there just label each one so you know where to put it in the new server.
Once you've got the new box cabled up, on the same build of VMware as the old server, and powered on here's all you need to do.
First put the host into maintenance mode.  This is required or the next step will not work.  You can use the hostname, IP address, or FQDN if you want.
Set-VMHost -VMHost esx1 -State “Maintenance”
Next enter the restore command.
Set-VMHostFirmware -VMHost -Restore -Force -SourcePath
Once you do this the host will immediately restart.  During the restart it will import the backed up configuration prior to completing the loading process.
After the host has fully restarted you will be able to see that all of your prior settings have been restored including those many times complicated network, VLAN, and MTU settings.
On the hosts I have performed this on if they have local storage I have had to configure the large datastore again but given how much time this saves that's a minor thing to get the new server online much, much quicker.
Good luck with your upgrades!







Sunday, December 14, 2014

vMotion Fails at 14% - Operation Timed Out

While working on a 3 host VMware cluster I was trying to vMotion some servers around and begin maintenance and updates.  I hit this error for the first time "Operation Timed Out" and the dreaded red X.

As it turns out there was a vmx-****.vswp file inside the VM folder that apparently was left over from a failed DRS migration.  After doing some research I found out that during a DRS migration the VMX file is started on both nodes.  Once the migration is completed normally one of these gets removed.  In this case it did not.

If you browse the datastore of the VM that will not move and you open up the folder of the VM you should see two vmx-****.vswp files.  If you see only one then you've got another issue and this isn't the fix.  If you do see two they will be .vswp-1 and .vswp-2.  There could be a .vswp for the VM itself.  DON'T DELETE THAT ONE!  I can't stress that enough.

To know which one to get rid of just look at the time stamps.  If the VM is running it may be hard to tell which is which so make sure you turn the VM off before you begin this process.  Once it's off then whichever file remains in the folder is the one you need to delete.

You can try deleting the file using the datastore browser but if that doesn't work then here's how you can remove it.

1. Start the SSH daemon on the host which has the VM registered and then login via SSH.  I recommend Putty.  You can download it HERE along with many other great tools for network and systems maintenance.
2. # cd /vmfs/volumes/{datastore name}
3. # cd {VM folder name}
4. # ls -lash *.vswp (this will show all the files and timestamps just to verify)
5. # rm vmx-{VM name}-[1-2].vswp

That's all there is to it.  Remember to disable the SSH daemon on your host and now you should be able to vMotion the VM again with it running.

Monday, July 09, 2012

How to Create a USB install disc from ESXi ISO file.

I had to setup ESXi on some brand new Gen 8 HP ProLiant servers that had two hard drive cages and no optical drive.  Since I never carry a USB optical drive this was the best way to go.

I've outline a few very simple steps below to make your USB key bootable with ESXi so just boot from the USB drive and you're good to go.

Good luck!

1. Download UNetbootin and run the software.  Here are links to the different versions you may need. (WindowsMac OS XLinux).

2. Download the VMware vSphere ISO file.  Note to use the newest 5.0.0 update 1 as of this writing. -> VMware Download Center.

3. Start the UNetbootin application and choose Diskimage (ISO) and browse to the downloaded ISO file.  There are several options of top for many operating systems and applications if you happen you want to make one of those as well.

4. Choose Type: USB Drive and choose the correct USB drive letter that you want the bootable installer to be installed to.

5. Let the program run and you are finished.  Make sure you edit the boot sequence in your BIOS (UEFI mode on some systems) to boot from USB instead of CD/DVD-ROM or HDD.

The vSphere 5 documentation can be found online here.