VMware VI SDK information

The VI SDK allows you to control VMs and machines managed by an ESX or VC instance.

Here’s a link to the documentation: http://www.vmware.com/support/pubs/sdk_pubs.html

1. A good place to start for a tutorial is the VMware SDK Webinar series here: http://act.vmware.com/servlet/website/R … lipghMM_si

2. The most complete VMware Developer resources are http://www.vmware.com/support/developer/ & http://www.vmware.com/support/developer/vc-sdk/ (includes Porting Guide, Programming Guide, Reference Guide, etc)

Here’s a link to the reference guide: http://www.vmware.com/support/developer … index.html

3. VMware Discussion Forum dedicated to the APIs: http://www.vmware.com/community/categor … goryID=114

[ad#ad-1]

How to manually build an initrd for ESX 3.5

notes came from here:

http://communities.vmware.com/thread/116768

Hi,

i managed to get my ESX3.5 to boot and run on a HP ML 115.

onboard raid: yes, this “raid” really sucks, because my rescue cd found 2 controllers/disks -> NO RAID

TODO-List to get ESX-3.5 up and running.

1.) install it from the cd (of course)

2.) reboot with a linux live cd of your choice.

and now i hope that there are no typos…because i created this “script” on my laptop during i tried and tested it on my ESX box!

mkdir /mnt/eboot
mkdir /mnt/eroot

1. /boot of ESX box

mount /dev/sda1 /mnt/eboot

1. /root of ESX box

mount /dev/sda2 /mnt/eroot

mkdir /mnt/eroot/tmp/initrd
mkdir /mnt/eroot/tmp/initrd/extracted
mkdir /mnt/eroot/tmp/initrd/extractednew

cp /mnt/eboot/boot/initrd-2.4.21-47.0.1.ELvmnix.img /mnt/eroot/tmp/initrd

cd /mnt/eroot/tmp/initrd
mv initrd-2.4.21-47.0.1.ELvmnix.img initrd-2.4.21-47.0.1.ELvmnix.img.gz
gunzip initrd-2.4.21-47.0.1.ELvmnix.img.gz
mount initrd-2.4.21-47.0.1.ELvmnix.img extracted -o loop

cd extracted
cd etc/vmware
cp simple.map simple.map.org

vi simple.map
2nd go for SED!

search for 037e
double this line
change one 037e to 037f
save

cd ..
cd ..

dd if=dev/zero of=initrd.img bs=1k count=97000
mke2fs -i 1024 -b 1024 -m 5 -F -v initrd.img

mount initrd.img extractednew -t ext2 -o loop

tar -C extracted/ -cmf – . | tar -C extractednew/ -xmf – .

1. umount initrd.img

umount extracted
umount extractednew

gzip -best initrd.img
ls -alh
mv initrd.img.gz initrd.img

cd /mnt/eboot
mv initrd-2.4.21-47.0.1.ELvmnix.img initrd-2.4.21-47.0.1.ELvmnix.img.org
cp /mnt/eroot/tmp/initrd/initrd.img initrd-2.4.21-47.0.1.ELvmnix.img

cd /mnt/eroot
cd etc
cd vmware

cp pci.ids pci.ids.org
vi pci.ids
2nd go for SED!

search for 037e
double this line
change one 037e to 037f
save

cp pci.xml.merged pci.xml.merged.org
vi pci.xml.merged
2nd go for SED!

search for 037e
double this SECTION
change one 037e to 037f
save

cd pciid
cp sata_nv.xml sata_nv.xml.org
vi sata_nv.xml
2nd go for SED!

search for 037e
double this SECTION
change one 037e to 037f
save

reboot from your resuce system into ESX and JUCHEEEEE….

kind regards,

Reinhard

________________________________________________________________________________________

#!/bin/bash

vmware esx initrd changer
#/bin/bash
Reinhard Partmann
date created: 2007-12-17
date modified: 2007-12-17
version: 0.2
echo “creating directories…”
mkdir -p /mnt/eboot
mkdir -p /mnt/eroot

echo “mounting..”
mount /dev/sda1 /mnt/eboot
mount /dev/sda2 /mnt/eroot
mount | grep sda

echo “copying original initrd file…”
mkdir -p /mnt/eroot/tmp/initrd/extracted
cp /mnt/eboot/initrd-2.4.21-47.0.1.ELvmnix.img /mnt/eroot/tmp/initrd/initrd-2.4.21-47.0.1.ELvmnix.img.gz
cd /mnt/eroot/tmp/initrd

echo “unpacking & mounting original initrd file…”
gunzip -f initrd-2.4.21-47.0.1.ELvmnix.img.gz
mount initrd-2.4.21-47.0.1.ELvmnix.img extracted -t ext2 -o loop
cd extracted
cd etc
cd vmware

echo “changing simple.map…”
echo “10de:037f 0000:0000 sata_nv.o” >> simple.map

cd ..
cd ..
cd ..

umount extracted
echo “replacing original initrd file…”
gzip –best initrd-2.4.21-47.0.1.ELvmnix.img
mv /mnt/eroot/tmp/initrd/initrd-2.4.21-47.0.1.ELvmnix.img.gz /mnt/eboot/
cp /mnt/eboot/initrd-2.4.21-47.0.1.ELvmnix.img.gz /mnt/eboot/initrd-2.4.21-47.0.1.ELvmnix.img

echo “patching xml files”

cd /mnt/eroot/etc/vmware/pciid
lines=`wc -l sata_nv.xml | awk ‘ { print $1 } ‘`
echo “lines: $lines”
(( lines -= 2))
echo “subtr lines: $lines”
mv sata_nv.xml sata_nv.xml.org
head -$lines sata_nv.xml.org > sata_nv.xml

echo ” ” >> sata_nv.xml
echo ” ” >> sata_nv.xml
echo ” sata_nv” >> sata_nv.xml
echo ” ” >> sata_nv.xml
echo ” MCP55 SATA Controller” >> sata_nv.xml
echo ” ” >> sata_nv.xml
echo ” ” >> sata_nv.xml
echo “” >> sata_nv.xml

touch /mnt/eroot/etc/init.d/rp-esxcfg-pciid-boot
echo “#!/bin/bash” >> /mnt/eroot/etc/init.d/rp-esxcfg-pciid-boot
echo “esxcfg-pciid” >> /mnt/eroot/etc/init.d/rp-esxcfg-pciid-boot
echo “sleep 5” >> /mnt/eroot/etc/init.d/rp-esxcfg-pciid-boot
echo “rm /etc/rc3.d/S99rp-esxcfg-pciid-boot” >> /mnt/eroot/etc/init.d/rp-esxcfg-pciid-boot
chmod a+x /mnt/eroot/etc/init.d/rp-esxcfg-pciid-boot
cd /mnt/eroot/etc/rc3.d/
ln -s ../init.d/rp-esxcfg-pciid-boot S99rp-esxcfg-pciid-boot

echo “cleanup…”
cd /
rm -f -r /mnt/eroot/tmp/initrd
umount /mnt/eboot
umount /mnt/eroot
rm -f -r /mnt/eboot
rm -f -r /mnt/eroot]]>

[ad#ad-1]

Re: How to build redhat kernel for VMware for time issue

In the guest, you’ll want to run NTP and not use the VMware tools time sync. It seems to work better. Also, you might also considering Ubuntu 7.1.0 instead as with ESX 3.5, VMware Server 2.0, and Workstation 6.0, it has a VMI option, so that you can run a paravirtualized kernel and get up to 30% better performance. It also doesn’t have the LSILogic scsi driver bug that everyone seems to run into.

ESX 3.5 RC1 runs beautifully on a Dell SC1430!

I was expecting that there might be some problems since it’s not on the HCL, but it seems it runs perfectly! SATA worked just fine! Created VMFS partitions right on the SATA drives! The broadcom nic was supported using the tg3 driver. I was pleasantly surprised as the install to deployment was very easy.

This came as a great deal from Dell when they sent me the 30% off coupons for Dell SMB where the 2nd proc came free, I got a quad core 1.6ghz box for just 761 or so out the door. From newegg, I got 2 2gb dimms and then CompUSA a couple of SATA 500gb hds for roughly a total of 440 or so. The total was less than 1200 for an awesome machine!

"not enough licenses" from VC is deceiving

error: “not enough licenses” 2. The vpxa log file seemed to point to a vmID192 having problems with accessing datastore. [2007-06-21 16:19:25.485 ‘App’ 84306864 warning] ============BEGIN FAILED METHOD CALL DUMP============
[2007-06-21 16:19:25.485 ‘App’ 84306864 warning] Invoking [GetConfig] on [vim.VirtualMachine:192]
[2007-06-21 16:19:25.485 ‘App’ 84306864 warning] Fault has an empty message
[2007-06-21 16:19:25.485 ‘App’ 84306864 warning] ============END FAILED METHOD CALL DUMP============
[2007-06-21 16:19:25.485 ‘App’ 84306864 error] [vm.GetConfig] Received exception in GetConfig: vmodl.fault.SystemError
[2007-06-21 16:19:28.803 ‘App’ 84306864 error] [VpxaVmprovUtil] Unable to lookup datastore EVA4000_VI3_VMFS6
[2007-06-21 16:19:28.803 ‘App’ 84306864 error] [vm.GetConfig] Received exception in GetConfigSnapshot: vim.fault.InvalidDatastorePath
[2007-06-21 16:19:28.950 ‘App’ 84306864 error] GetResult failed: not well-formed (invalid token)
[2007-06-21 16:19:28.950 ‘App’ 84306864 warning] 3. Looked at the vmInventory.xml file to find which VM that vmID belonged to. 4. Looked at the vmx file of this VM. One of the parameters SMBIOS.reflecthost had garbled information. Changed SMBIOS.reflecthost=TRUE 5. In order for the VM to take this value we did vmware-cmd Vmname setconfig SMBIOS.reflecthost=TURE. 6. Now we could add the host back into the VC server.]]>

quick way of setting up NTP on your ESX host.

You can just copy/paste the following lines:

esxcfg-firewall -e ntpClient

echo “server clock.redhat.com” >> /etc/ntp.conf

echo “clock.redhat.com” > /etc/ntp/step-tickers

/etc/init.d/ntpd restart

chkconfig ntpd on

Just replace clock.redhat.com with your NTP server. If you want more than one time server, just echo the lines more. Use >> for the step-tickers line to append rather than overwrite.

do NOT use service network restart to change the vswif0 IP!

If you’re using HA, this will break! If you just edit the /etc/sysconfig files to change your vswif IP, it will work, but will break HA as it will still think you still have your old IP. You will need to use esxcfg-vswif and delete and recreate the vswif. Also make sure you fix /etc/hosts as well.

How to configure HA failover custom settings on VI3

“FT_DIR=/opt/LGTOaam512/”
“FT_DOMAIN=vmware”
“export=FT_DIR FT_DOMAIN”
“cd /opt/LGTOaam512/bin”
“./ftcli” Now you should see the AAM prompt AAM> “AAM>getfailuredetectioninfo” You will see something like this: Heartbeat Interval: 1000
Heartbeat Timeout: 15000
Heartbeat Port: 8044
Multicast Address: 224.0.6.127 You can change the time out by: “AAM> setfailuredetectiontime 10000” To change this to 10 seconds You need to do this on all the members of the HA cluster.
The failover should kicks in by default setting when one member of the HA cluster lost network or powered down Hope this helps]]>

ESX 3.0.x – vmware-hostd is not cool …

If you’re using autostart for your VMs. You’ll have to be very careful because it will SHUTDOWN your VMs!

The way autostart works in 3.0.x is that your autostart will automatically start the VMs with hostd and shutdown with hostd, so you don’t want to be restarting mgmt-vmware if you’re using autostart for your VMs.