Tag Archives: vmware

Expand an EXT4, on a SCSI device

If you have vmware ESXi or Microsoft Hyper-v, you can expand a disk, from the hypervisor console, very simple. But afterwards the partition the servers is not expand.
It is always a good idea to create a Snapshot/checkpoint before. Just remember, that the disc can’t be expanded in Hyper-v when there are a checkpoint. So first expand the disk in Hyper-v and then create a snapshot.

To do this you first need to rescan the disk for change

echo "1" > /sys/class/block/sda/device/rescan

Replace sda with the disk name.
Then you can run fdisk -l /dev/sda, to see the disk information, if you got an error on the top like in the screenshot below

Then you need to repair the disk partition table.

parted -l

After you have check the partition table, you need to delete the old partition, and recreate it

This is done by type fdisk /dev/sda

In the fdisk, you type d to delete, choice the partition, in the example is two. (Beaware that this guide can only be used to expand the last partition on the disk, if you have multiple)
Then you type n to create a new one, and just goes for the default once settings.
In the end type N to not remove the signature.

Then you w to save the settings

Then we just have to resize the ext4 information on the disk, this is done by the command resize2fs

Afterwards you can check that the server have been expand by the command df -h

Here we have expand the disk from 195GB to 295GB.

VMWare – Certificate Status Trigger alarm Alert

Back in December i replaced my Certificate on my VMWare Appliance with a our new Wildcard certificate.
But here in January, i got an alarm saying “Certificate Alarm” and it trigger it as an Alert.

Searching around for a solution, on what certificate that expire soon, i found this command:

for i in $(/usr/lib/vmware-vmafd/bin/vecs-cli store list); do echo STORE $i; /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store $i --text | egrep "Alias|Not After"; done

It showing me that a backup mackine certificate is expiring

STORE MACHINE_SSL_CERT
Alias : __MACHINE_CERT
            Not After : Jan 15 14:20:36 2022 GMT
STORE TRUSTED_ROOTS
Alias : b4a1550d09628bfe628d2685fe24f2b67afb9855
            Not After : Jan 31 10:55:48 2025 GMT
Alias : 7a1f6edf1e16498c4eff9190fa5ef6742bbdde0e
            Not After : Dec  4 14:03:36 2026 GMT
Alias : 909c4328a37dcff3d72de88c51df6f63600fc3f3
            Not After : Dec  4 14:03:36 2026 GMT
Alias : 98c6a8dc887963ba3cf9c2731cbdd3f7de05ac2d
            Not After : Nov  6 12:23:33 2027 GMT
Alias : 91c489ecb94b64e2eeffe438a0ad3fc1465959a2
            Not After : Jan 15 14:20:36 2022 GMT
Alias : 4c27431717565a3a07f3e6d0032c4258949cf9ec
            Not After : Feb 20 10:00:00 2024 GMT
Alias : b1bc968bd4f49d622aa89a81f2150152a41d829c
            Not After : Jan 28 12:00:00 2028 GMT
STORE TRUSTED_ROOT_CRLS
Alias : bcd1699f713eabf1dbd8a21618ea6b0487adbdc8
STORE STS_INTERNAL_SSL_CERT
Alias : __MACHINE_CERT
            Not After : Dec  4 14:03:36 2026 GMT
STORE machine
Alias : machine
            Not After : Jan 31 10:55:48 2025 GMT
STORE vsphere-webclient
Alias : vsphere-webclient
            Not After : Jan 31 10:55:48 2025 GMT
STORE vpxd
Alias : vpxd
            Not After : Jan 31 10:55:48 2025 GMT
STORE vpxd-extension
Alias : vpxd-extension
            Not After : Jan 31 10:55:48 2025 GMT
STORE SMS
Alias : sms_self_signed
            Not After : Feb  3 11:51:48 2025 GMT
STORE BACKUP_STORE
Alias : bkp___MACHINE_CERT
            Not After : Jan 20 12:00:00 2021 GMT
Alias : bkp_machine
            Not After : Jan 31 10:55:48 2025 GMT
Alias : bkp_vsphere-webclient
            Not After : Jan 31 10:55:48 2025 GMT
Alias : bkp_vpxd
            Not After : Jan 31 10:55:48 2025 GMT
Alias : bkp_vpxd-extension
            Not After : Jan 31 10:55:48 2025 GMT

So i exported this Machine certificate to a CRT file, and then deleted it with these commands

mkdir /certificates

/usr/lib/vmware-vmafd/bin/vecs-cli entry getcert --store BACKUP_STORE --alias bkp___MACHINE_CERT --output /certificates/old_machine.crt

/usr/lib/vmware-vmafd/bin/vecs-cli entry delete --store BACKUP_STORE --alias bkp___MACHINE_CERT -y

It then tell me that the certificate have been deleted

Deleted entry with alias [bkp___MACHINE_CERT] in store [BACKUP_STORE] successfully

Also running this command again

for i in $(/usr/lib/vmware-vmafd/bin/vecs-cli store list); do echo STORE $i; /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store $i --text | egrep "Alias|Not After"; done

Show that the certificate have now gone.

Move vSwitch vlans information from old host to a new one

To use this examples, there requirements are: VMware PowerCLI and a VMWare vCenter.

This example will copy all vlan’s (Virtualportgroup) from one host to another.
It will take all vlan’s from vSwitch0 on the old host, and copy it to the new host on vSwitch1.

connect-viserver
$oldhost = get-vmhost -name OldServerIP
$newhost = get-vmhost -name NewServerIP
 
$oldhost | get-virtualswitch -name vSwitch0 | get-virtualportgroup | foreach { $newportgroup = $newhost | get-virtualswitch -name vSwitch1 | new-virtualportgroup -name $_.Name -VLanID $_.VLanID }

 

Install Dell OpenManage on ESXi 5.1 host

If you have follow my guide to install the Dell Openmanage on a ESXi 4.1 host, and try the same thing on a ESXi 5.1 you will get a warning from the host saying:
This operation is NOT supported on 5.1.0 platform.

You need to install it directly on the ESXi host in 5.1 version.
So you just need to upload the Dell OM-SrvAdmin-Dell-Web-7.2.0-6945.VIB-ESX51i.zip file to the host, i will do this with WinSCP, i will put in the /tmp directory.

Then SSH to the host and run this commands:

esxcli software vib install –d /tmp/OM-SrvAdmin-Dell-Web-7.2.0-6945.VIB-ESX51i.zip

Output:

~ # esxcli software vib install -d /tmp/OM-SrvAdmin-Dell-Web-7.2.0-6945.VIB-ESX51i.zip
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: Dell_bootbank_OpenManage_7.2-0000
   VIBs Removed:
   VIBs Skipped:

After you have install the VIB packages successfully, the ESXi 5.1 host needs to be restarted. When the host is ready again, you should be able to see that UserVars.CIMvmw_OpenManageProviderEnabled is set to 1. In this location

Select the host and go to the Configuration tab. Click on Advanced Settings and find the UserVars.CIMvmw_OpenManageProviderEnabled, and check that this is set to 1. In ESXi 4.1, this is UserVars.CIMoemProviderEnabled

Stop error 0xc0000225 on P2V’d Windows 2008 R2

I have P2V a windows 2008 R2, from Xenserver to vmware.

But after the first good boot, it come with: Status: 0xc0000225, Info: The boot selection failed because a required device is inaccessible.

The machine will startup just fine one time, first i thougt it was the uninstall of XenServer tools?.
So i try to remove the Xenserver tools, before the P2V, but again i godt 0xC000225 error again.

I then google it, and found this post: http://web2.minasi.com/forum/topic.asp?TOPIC_ID=31980, and the fix was pretty simple:

  • Mount the Windows 2008 R2DVD in VMware and boot the virtual machine, with CDRom boot at the first boot device.
  • Hit any key to boot from the CDRrom.
  • At the first screen of the installation (Language Selection), you can hit Shift-F10 to get a command prompt.
  • Type Regedit at the command prompt.
  • Loaded hive HKEY_LOCAL_MACHINE (which mounts as a sub-hive)
    1. Highlight HKEY_LOCAL_MACHINE
    2. File > Load Hive
    3. Select < c: > \Windows\System32\config\system (name it something like “qwerty”)
  • Expand HKEY_LOCAL_MACHINE\qwerty\ControlSet001\Services\intelide
  • Change the data for value “Start” from “3” to “0”.
  • File > Unload Hive.
  • Exit regedit.
  • Reboot the VM.

 

Revert to snapshot causes virtual machine to be suspended

Error:

host cpu is incompatible with the virtual machine’s requirements at cpuid level 0x1

Details

If you take a snapshot of the virtual machine and then VMotion or cold-migrate the virtual machine to another host that uses a different CPU model and/or family, you may experience the following symptoms:

  • The virtual machine becomes stuck in a suspended state after performing a Revert to Snapshot operation
  • If you try to remove the virtual machine from its suspended state, you see the error:
    Error: error encounter trying to restore cpu state from file.

Solution

This issue may occur if the CPU information as recorded in the virtual machine configuration file (.vmx) after the Revert to Snapshot operation does not match the current CPU information. If this occurs, the server does not un-suspend the virtual machine.
To resolve this issue, you must remove the checkpoint.* lines from the .vmxfile. Removing these lines allows you to power on the virtual machine.
To remove the checkpoint.* lines:
  1. Ensure that the virtual machine is not running another process.
  2. Unregister the virtual machine.
  3. Open the .vmx file in a text editor.
  4. Remove the checkpoint.* lines from the file.
  5. Save and close the file.
  6. Re-register the virtual machine.

    The virtual machine is in a powered off state. You can now power it on.

Vmware ESX 3.5 and Dell openmanage

First you need to install:
http://www.vmware.com/download/download.do?downloadGroup=VI-RCLI-U2

This is a vmware Remote CLI tools. Install it on a windows machine.
After you install remember to log out and the log in, else you will get some error about libxml.dll cannot be found.

Then download Dell Openmanage  to the same machine that you install Vmware Remote CLI:

http://support.dell.com/support/downloads/format.aspx?c=us&cs=04&l=en&s=bsd&deviceid=2331&libid=36&releaseid=R251021&vercnt=3&formatcnt=0&SystemID=PWE_R710&servicetag=&os=LIN4&osl=en&catid=-1&dateid=-1&typeid=-1&formatid=-1&impid=-1&checkFormat=true

Put the Vmware ESX into maintaince mode.

Put tar.gz file  onto the ESX Host, and the untar the file, and then install the Dell Openmanage

tar zxfv OM_6.2.0_ManNode_A00.tar.gz
cd openmanage
sh setup.sh

Make sure that the Dell openmanage is install on the ESX.

Check if the Dell openmanage is started

/opt/dell/srvadmin/dataeng/bin/dataeng status if not then start it: /opt/dell/srvadmin/dataeng/bin/dataeng start (This commands should be run at the ESX host)

Enable SNMP in the firewall:

esxcfg-firewall -e snmpd
esxcfg-firewall –openPort 1311,tcp,in,OpenManageRequest

On the windows machine where you have install Remote CLI goto folder: C:\Programmer\VMware\VMware VI Remote CLI\bin

vicfg-snmp.pl –server <ESX Host> –username root -c appmanager -p 5567 -t 10.105.2.129/appmanager

vicfg-snmp.pl –server <ESX Host> –username root -E

If you need to test the SNMP traps you can run this command

vicfg-snmp.pl –server <ESX Host> –username root -T

Vmware ESXi (ESX) 4.0 and Dell Openmanage SNMP Traps

First you need to install:
http://www.vmware.com/downloads/download.do?downloadGroup=VCLI40U1

This is a vmware CLI tools. Install it on a windows machine.
After you install remember to log out and the log in, else you will get this error:

Can’t load ‘C:/Program Files/VMware/VMware VI Remote CLI/Perl/site/lib/auto/XML/LibXML/Common/Common.dll’ for module XML::LibXML::Common: load_file:The specified module could not be found at C:/Program Files/VMware/VMware VI Remote CLI/Perl/lib/DynaLoader.pm line 230.

Then download Dell Openmanage  offline bundle to the same machine that you install Vmware vsphere CLI:

http://support.dell.com/support/downloads/download.aspx?c=us&cs=04&l=en&s=bsd&releaseid=R250294&SystemID=pwe_r710&servicetag=GWT2J4J&os=EIx4&osl=en&deviceid=21859&devlib=0&typecnt=0&vercnt=1&catid=-1&impid=-1&formatcnt=0&libid=36&typeid=-1&dateid=-1&formatid=-1&source=-1&fileid=365571

Put the Vmware ESXI into maintaince mode.

Start a dos prompt, and go to:

c:\program fileres\vmware\VMware vSphere CLI\bin

Type

vihostupdate.pl –server <IP address of ESXi 4 Host> -i -b <path to Dell OpenManage file>   (On the windows machine)

Reboot the Vmware ESXi machine.

vicfg-advcfg.pl –server <IP address of ESXi 4 Host> –set 1 UserVars.CIMoemProviderEnabled

Reboot the Vmware ESXi machine once again.

Make sure that the Dell openmanage is install on the ESXi.
/usr/lib/ext/dell/dataeng status if not then start it: /usr/lib/ext/dell/dataeng start (This commands should be run at the ESXi host)

vicfg-snmp.pl –server <IP address of ESXi 4 Host> -t <IP address of SNMP Traps destination>/<SNMP community> (On the windows machine)

And this command for enable SNMP Traps
vicfg-snmp.pl –server <IP address of ESXi 4 Host> -E (On the windows machine)

And then this to make Dell Openmanage happy about the SNMP traps configuration.
vicfg-snmp.pl –server <IP address of ESXi 4 Host> -c appmanager

Exit the maintenance mode.

If you need to test the SNMP traps you can run this command

vicfg-snmp.pl –server <IP address of ESXi 4 Host> -T  (On the windows machine)

And if you need to access the openmanage web interface, start Dell openmanage on a windows machine, and then logout (Right corner), and then on the login screen click on “Manage Remote Node”.

Type the ESXi hostname the username is root and the password is the password for root and tick the Ignore Certificate Warnings. Then click login.

Vmware Server 1.0.5-80187 on Ubuntu 8.04

I have some trouble install vmware-mui on my Ubuntu 8.04.

I got it fix, doing this:

ln -s /usr/lib/vmware-mui/lib/libcrypto.so.4 /lib/libcrypto.so.4
ln -s /usr/lib/vmware-mui/lib/libssl.so.4 /lib/libssl.so.4
ln -s /usr/lib/vmware-mui/lib/libcrypto.so.4 /lib/libcrypto.so.4

And after that i edit /etc/init.d/httpd.vmware
And go line 256.

I change so that vmware_exec “Starting httpd.vmware:” vmware_start_httpd is call over 2 lines se above. And also vmware_exec  “Shutting down http.vmware: ” vmware_stop_httpd this i change to 2 lines.

# See how we were called.
case “$1” in
start)
#vmware_exec “Starting httpd.vmware:” vmware_start_httpd
echo “Starting httpd.vmware:”
vmware_start_httpd
;;
stop)
#vmware_exec  “Shutting down http.vmware: ” vmware_stop_httpd
echo “Shutting down http.vmware: ”
vmware_stop_httpd
;;