Showing posts with label VMWare. Show all posts
Showing posts with label VMWare. Show all posts

Tuesday, October 13, 2020

vCenter 6.7 Resizing Disk Fails Invalid Operation for Device 0

 This one has been around for some time but now due to the data drive on my Exchange server getting closer and closer to full, I had to find a fix and here it is.  So simple and yet so hard to find on the web.

Checking the D: drive on the Exchange server showed the disk had a size of 150.254450347GB.  This disk had been restored from Datto at some point in the past and since that date this was the size showing.

Whenever attempting to expand the drive vCenter thew this error:  Invalid operation for device '0'.

I tried different sizes from adding just a few gigs to going all the way up to 200GB but getting the same error.

Ready for the fix?  You won't believe how easy it was.

1. Log into vCenter using the flex (Flash) client instead of the HTML 5 client.

2. Resize your disk successfully.


THAT'S IT!!  Can you believe it?  After all of these articles I read about changing the parameters on the VMX file, cloning the server, etc. etc. it turned out to be the behavior of the HTML 5 client.  Let's hope VMware fixes this in the next versions of vCenter before they fully remove the Flash functionality.

Good luck!

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.

Tuesday, August 27, 2013

Installing VMware Tools on Ubuntu or Ubuntu Server


Ubuntu or Ubuntu Server with a Graphical User Interface

To mount the CD image and extract the contents:
  1. Power on the virtual machine.
  2. Log into the virtual machine using an account with administrator or root privileges.
  3. Go to Virtual Machine > Install VMware Tools (or VM > Install VMware Tools)..

    Note: If you are running the light version of Fusion, a version of Workstation without VMware Tools, or VMware Player, you are prompted to download Tools before they can be installed. Click Download Now to begin the download.
  4. Open the VMware Tools CD mounted on the Ubuntu desktop.
  5. Right-click the file name that is similar to VMwareTools.x.x.x-xxxx.tar.gz, click Extract to, and select the Ubuntu Desktop to save the extracted contents.

    The vmware-tools-distrib folder is extracted to the Ubuntu Desktop.
To install VMware Tools in Ubuntu:
  1. Open a Terminal windows.
  2. In Terminal, run this command to navigate to the vmware-tools-distrib folder:

    cd Desktop/vmware-tools-distrib
  3. Run this command to install VMware Tools:

    sudo ./vmware-install.pl -d

    Note: The -d switch assumes that you want to accept the defaults. If you do not use -d, press Return to accept the defaults or supply your own answers.
  4. Enter your Ubuntu password.
  5. Restart the Ubuntu virtual machine after the VMware Tools installation completes.

Monday, August 27, 2012

Integrating XenDesktop 5.6 with VMWare VCenter 5 Certificate Error


I ran into this issue earlier today while configuring my first XenDesktop setup using VMWare.  To resolve this issue, you can do one of three things.

Option 1: Purchase an SSL certificate for your vCenter from a third party.

Option 2: Self-sign a certificate from your enterprise certificate authority.

Option 3: Trust the existing SSL certificate  This option is by far the quickest and easiest. To do that, you can follow these steps:
  1. If you are logged in as a local administrator, open Internet Explorer and navigate to https://YOURVCENTERSERVERNAME/
  2. If you are not logged in as local administrator, or a user with sufficient permissions, it is very important that you SHIFT & Right-Click Internet Explorer, and run it as an Administrator, then navigate to https://YOURVCENTERSERVERNAME/
  3. You will get a warning screen that the SSL Certificate is not trusted, select Continue to this web site (not recommended).
  4. Click the Certificate error in the Security Status bar and select View Certificate.
  5. Click Install Certificate.
  6. When the Certificate Import Wizard launches, select Place All Certificates in the following store and click Browse.
  7. When the Select Certificate Store window comes up, make sure you select the check box for Show physical stores.
  8. Find and expand Trusted People, select Local Computer and click OK.
  9. It is important to note that if you don't see the Local Computer option under trusted People, you are not logged in with a user that has sufficient rights, therefore, you must run Internet Explorer as an Administrator.
  10. Click Finish to complete the certificate import process
  11. Click OK when you receive the import successful window
  12. Close your browser, re-open it again, and browse to your vCenter server using the FQDN. The browser should now trust your vCenter server and therefore you should not receive a certificate error. That is how you can verify if the process was successful.  Make sure you test using the FQDN or it will not work.
  13. Repeat the above steps on the XenDesktop server as well.  That way both machines trust the self-signed certificate.
  14. Configure the hosting infrastructure settings on the XenDesktop 5 controller to point to https://vCenterServer.domain.com/sdk
That's it.  From there you can continue with your configuration.

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.