Tag Archives: vmware

Commit a VMware snapshot from ESXi as it doesn’t appear in vCenter or command line tools

First of all we get the ID of our VM:

# vim-cmd vmsvc/getallvms

Check his snapshots:

# vim-cmd vmsvc/snapshot.get <vmid>
Get Snapshot:

We can see that we don’t have any snapshot but that’s not true:

# ls -l *vmdk
-rw-------    1 root     root       6554112 Oct 30 20:55 vm-000001-ctk.vmdk
-rw-------    1 root     root   16559525888 Oct 30 20:55 vm-000001-delta.vmdk
-rw-------    1 root     root           393 Apr 21  2014 vm-000001.vmdk
-rw-------    1 root     root       6554112 Apr  3  2014 vm-ctk.vmdk
-rw-------    1 root     root  214748364800 Apr  3  2014 vm-flat.vmdk
-rw-------    1 root     root           585 Apr  2  2014 vm.vmdk

In order to fix it, first of all shutdown the VM as it can’t be fixed online:

# vim-cmd vmsvc/power.shutdown <vmid>

And we commit the snapshot manually from command line to a new disk (it can take some time):

# vmkfstools -i vm-000001.vmdk new.vmdk
Destination disk format: VMFS zeroedthick
Cloning disk 'vm-000001.vmdk'...
Clone: 100% done.

If the task was successfully now we overwrite our old files and delete the delta disk (I suppose that you have backups just in case something goes south):

# mv new-ctk.vmdk vm-ctk.vmdk
# mv new-flat.vmdk vm-flat.vmdk
# mv new.vmdk vm.vmdk
# rm *000001*

And finally edit your vmx/vmdk file to reflect this changes:

# grep vmdk *vmx
scsi0:0.fileName = "vm.vmdk"
# grep vmdk vm.vmdk 
RW 419430400 VMFS "vm-flat.vmdk"
changeTrackPath="vm-ctk.vmdk"

And if you powerup your VM everything should be back to normal!

If you have more than one snapshot this might be handy:

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

Nested RHEV-H 3.x and VMware ESXi 5.5

I was trying to setup a RHEV laboratory in my ESXi but I wasn’t unable to approve my host.

In RHEVM appeared an error in the GUI like this one (check your Events tab):

Command returned failure code 1 during SSH session '[email protected]'

But in RHEVM logs there was another latent issue, checking /var/log/ovirt-engine/engine.log :

2014-04-27 12:17:20,814 ERROR [org.ovirt.engine.core.bll.InstallerMessages] (VdsDeploy) Installation x.x.x.x: Failed to execute stage 'Setup validation': Hardware does not support virtualization
...
2014-04-27 12:18:48,555 ERROR [org.ovirt.engine.core.bll.InstallVdsCommand] (pool-4-thread-49) [1c11a8d3] Host installation failed for host 4eba0c68-4370-4223-8271-831cccf3a64e, x.x.x.x.: java.io.IOException: Command returned failure code 1 during SSH session '[email protected]'

So in order to enables nested virtualization of RHEV-H in VMware ESXi 5.5u1 we have to add 2 new values in our vmx file:

featMask.vm.hv.capable = "Min:1"
vhv.enable = "TRUE"

After adding them I was able to approve the host without any further issues.

VMware heartbleed – ESXi 5.5 U1 and vCSA 5.5 U1

VMware has already released patches (19/4/2013) for ESXi and vCSA 5.5U1, newest versions are:

VMware vCenter Server Appliance – 5.5.0 U1a – 5.5.0.10100 Build 1750781
VMware ESXi – 5.5.0 U1 – VMware ESXi 5.5.0 build-1746018

VMkernel esxi 5.5.0 #1 SMP Release build-1746018 Apr 15 2014 02:08:35 x86_64 GNU/Linux

More info in: https://www.vmware.com/security/advisories/VMSA-2014-0004.html

Did you already upgrade them? Let’s keep our private keys private ūüôā

Soyoustart – How to upgrade VMware ESXi 5.5 to latest patch?

1) Download ESXi patch from VMware site:

https://my.vmware.com/group/vmware/patch#search

2) Put your ESXi patch in your datastore (ex: datastore02)

3) SSH to ESXi and list profiles in our patch

~ # esxcli software sources profile list -d=[datastore02]/00-isos/ESXi550-201312001.zip
Name                              Vendor        Acceptance Level
--------------------------------  ------------  ----------------
ESXi-5.5.0-20131204001-no-tools   VMware, Inc.  PartnerSupported
ESXi-5.5.0-20131204001-standard   VMware, Inc.  PartnerSupported
ESXi-5.5.0-20131201001s-standard  VMware, Inc.  PartnerSupported
ESXi-5.5.0-20131201001s-no-tools  VMware, Inc.  PartnerSupported

4) Install your new profile

~ # esxcli software profile install -d=[datastore02]/00-isos/ESXi550-201312001.zip -p "ESXi-5.5.0-20131204001-standard" --ok-to-remove

5) Set your acceptance level to CommunitySupported

~ # esxcli software acceptance set --level=CommunitySupported

6) Install custom vib driver for our Intel NIC 82579V

~ # esxcli software vib install -v http://files.v-front.de/net-e1001e-1.0.0.x86_64.vib
Installation Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: Chilly_bootbank_net-e1001e_1.0.0
VIBs Removed:
VIBs Skipped:

7) Reboot and cross your fingers

~ # reboot

8) Check if our build number has been upgraded!

~ # uname -a
VMkernel xxxx 5.5.0 #1 SMP Release build-1331820 Sep 18 2013 23:08:31 x86_64 GNU/Linux
~ # uname -a
VMkernel xxxx 5.5.0 #1 SMP Release build-1474528 Dec 11 2013 03:54:09 x86_64 GNU/Linux

Soyoustart – How to upgrade VMware ESXi 5.0 to ESXi 5.5? (Serie SYS)

Note: I’ve tested this procedure with just one server from serie SYS: SYS-E32-1

1) SSH to ESXi

2) List all profiles available from VMware depot site

~ # esxcli software sources profile list -d http://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep 5.5
ESXi-5.5.0-20131201001s-standard  VMware, Inc.  PartnerSupported
ESXi-5.5.0-1331820-no-tools       VMware, Inc.  PartnerSupported
ESXi-5.5.0-20131204001-standard   VMware, Inc.  PartnerSupported
ESXi-5.5.0-1331820-standard       VMware, Inc.  PartnerSupported
ESXi-5.5.0-20131201001s-no-tools  VMware, Inc.  PartnerSupported
ESXi-5.5.0-20131204001-no-tools   VMware, Inc.  PartnerSupported

3) Install latest ESXi version from VMware depot site, ESXi-5.5.0-1331820-standard

esxcli software profile install -d http://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.5.0-1331820-standard --ok-to-remove

4) Set your acceptance level to CommunitySupported

~ # esxcli software acceptance set --level=CommunitySupported

5) Install custom vib driver for our Intel NIC 82579V

esxcli software vib install -v http://files.v-front.de/net-e1001e-1.0.0.x86_64.vib

6) Reboot and cross your fingers

~ # reboot

6) If everything worked ok your new build should be 1331820

~ # uname -a
VMkernel xxxx 5.5.0 #1 SMP Release build-1331820 Sep 18 2013 23:08:31 x86_64 GNU/Linux

Turn on a VMware VM with vim-cmd

Currently there isn’t a native application for VMware vSphere client for OSX or even Linux, vCenter Web†Management HTML†client is †an option but what happens if you don’t have a vCenter license or you don’t want to use your VMA so….

In order to power up a VM we only just need to SSH in our ESXi server and:

vim-cmd vmsvc/getallvms
vim-cmd †vmsvc/power.on

And we’ll have our VM up and running in a few seconds!