Virtualization Adapted Adapting Business Processes for Virtual Infrastrcuture (and vice-versa)

2009/04/16

VMware ESX host command line configuration script

Filed under: Uncategorized — Tags: , , , , — iben @ 14:46

#customize esxXX by IR Date YYYYMMDD
# ESX host configuration script for company.com
# configure as needed for esxXX by changing IP addresses below…
# configure 4 nics for nfs storage
# nic 1 and 3 – cos1, vms, vmotion
# nic 2 and 4 – vmkernel for nfs storage
#

#configure SYSLOG
echo “*.* @syslog.site.company.com” >> /etc/syslog.conf
service syslog restart

# List current config
/usr/sbin/esxcfg-nics -l
/usr/sbin/esxcfg-vswitch -l

#creating virtual switches
/usr/sbin/esxcfg-vswitch -a vSwitch1
/usr/sbin/esxcfg-vswitch -L vmnic1 vSwitch1
/usr/sbin/esxcfg-vswitch -L vmnic3 vSwitch1
/usr/sbin/esxcfg-vswitch -L vmnic2 vSwitch0
#enable CDP advertise and listen mode
/usr/sbin/esxcfg-vswitch -b vSwitch0
/usr/sbin/esxcfg-vswitch -b vSwitch1
/usr/sbin/esxcfg-vswitch -B both vSwitch0
/usr/sbin/esxcfg-vswitch -B both vSwitch1
/usr/sbin/esxcfg-vswitch -b vSwitch0
/usr/sbin/esxcfg-vswitch -b vSwitch1

#creating portgroups
/usr/sbin/esxcfg-vswitch -A “ITG-VLAN2” vSwitch0
/usr/sbin/esxcfg-vswitch -A “PUBLIC-VLAN4” vSwitch0
/usr/sbin/esxcfg-vswitch -A “VMkVMotion-VLAN209” vSwitch0
/usr/sbin/esxcfg-vswitch -A “VMkStorage-VLAN207” vSwitch1
#/usr/sbin/esxcfg-vswitch -A “Service Console” vSwitch0
/usr/sbin/esxcfg-vswitch -A “Service Console 2” vSwitch0
/usr/sbin/esxcfg-vswif -a -i 10.102.8.111 -n 255.255.255.0 -p “Service Console 2” vswif1
/usr/sbin/esxcfg-vswitch -A “ESX-VLAN208” vSwitch0
/usr/sbin/esxcfg-vmknic -a -i 10.102.7.211 -n 255.255.255.0 VMkStorage-VLAN207
/usr/sbin/esxcfg-vmknic -a -i 10.102.9.211 -n 255.255.255.0 VMkVMotion-VLAN209
/usr/sbin/esxcfg-route -a 0.0.0.0/0 10.102.7.1
/usr/sbin/esxcfg-vswif -l
/usr/sbin/esxcfg-vmknic -l

vmware-vim-cmd hostsvc/net/vswitch_setpolicy –nicteaming-policy=loadbalance_ip vSwitch0
vmware-vim-cmd hostsvc/net/vswitch_setpolicy –nicteaming-policy=loadbalance_ip vSwitch1
vmware-vim-cmd /hostsvc/net/vswitch_setpolicy –failurecriteria-check-beacon 0 vSwitch0
vmware-vim-cmd /hostsvc/net/vswitch_setpolicy –failurecriteria-check-beacon 0 vSwitch1
vmware-vim-cmd hostsvc/net/vswitch_setpolicy –securepolicy-promisc=false vSwitch0
vmware-vim-cmd hostsvc/net/vswitch_setpolicy –securepolicy-macchange=false vSwitch0
vmware-vim-cmd hostsvc/net/vswitch_setpolicy –securepolicy-forgedxmit=false vSwitch0
vmware-vim-cmd hostsvc/net/vswitch_setpolicy –securepolicy-promisc=false vSwitch1
vmware-vim-cmd hostsvc/net/vswitch_setpolicy –securepolicy-macchange=false vSwitch1
vmware-vim-cmd hostsvc/net/vswitch_setpolicy –securepolicy-forgedxmit=false vSwitch1

#configuring vlans
/usr/sbin/esxcfg-vswitch -l
/usr/sbin/esxcfg-vswitch -v 2 -p “ITG-VLAN2” vSwitch0
/usr/sbin/esxcfg-vswitch -v 4 -p “PUBLIC-VLAN4” vSwitch0
/usr/sbin/esxcfg-vswitch -v 207 -p “VMkStorage-VLAN207” vSwitch1
/usr/sbin/esxcfg-vswitch -v 209 -p “VMkVMotion-VLAN209” vSwitch0
/usr/sbin/esxcfg-vswitch -v 208 -p “Service Console” vSwitch0
/usr/sbin/esxcfg-vswitch -v 208 -p “Service Console 2” vSwitch0
/usr/sbin/esxcfg-vswitch -v 208 -p “ESX-VLAN208” vSwitch0
/usr/sbin/esxcfg-vswitch -l

#delete vmnic1 from vSwitch0 (run these if necessary)
#/usr/sbin/esxcfg-vswitch -N vmnic1 -p “ITG-VLAN2” vSwitch0
#/usr/sbin/esxcfg-vswitch -N vmnic1 -p “PUBLIC-VLAN4” vSwitch0
#/usr/sbin/esxcfg-vswitch -N vmnic1 -p “VMkStorage-VLAN207” vSwitch0
#/usr/sbin/esxcfg-vswitch -N vmnic1 -p “VMkVMotion-VLAN209” vSwitch0
#/usr/sbin/esxcfg-vswitch -N vmnic1 -p “Service Console” vSwitch0
#/usr/sbin/esxcfg-vswitch -N vmnic1 -p “Service Console 2” vSwitch0
#/usr/sbin/esxcfg-vswitch -N vmnic1 -p “ESX-VLAN208” vSwitch0

#add vmnics to each port group
/usr/sbin/esxcfg-vswitch -M vmnic2 -p “ITG-VLAN2” vSwitch0
/usr/sbin/esxcfg-vswitch -M vmnic2 -p “PUBLIC-VLAN4” vSwitch0
/usr/sbin/esxcfg-vswitch -M vmnic1 -p “VMkStorage-VLAN207” vSwitch1
/usr/sbin/esxcfg-vswitch -M vmnic3 -p “VMkStorage-VLAN207” vSwitch1
/usr/sbin/esxcfg-vswitch -M vmnic2 -p “VMkVMotion-VLAN209” vSwitch0
/usr/sbin/esxcfg-vswitch -M vmnic2 -p “Service Console” vSwitch0
/usr/sbin/esxcfg-vswitch -M vmnic2 -p “Service Console 2” vSwitch0
/usr/sbin/esxcfg-vswitch -M vmnic2 -p “ESX-VLAN208” vSwitch0
/usr/sbin/esxcfg-vswitch -l

sleep 10

#setup vmotion on the first vmk network
#vmware-vim-cmd “hostsvc/vmotion/netconfig_get” (check config)
vmware-vim-cmd hostsvc/vmotion/vnic_set vmk1

#/usr/sbin/esxcfg-vswitch -l

vmware-vim-cmd /hostsvc/net/portgroup_set –nicorderpolicy-active=vmnic0 vSwitch0 “Service Console”
vmware-vim-cmd /hostsvc/net/portgroup_set –nicorderpolicy-standby=vmnic2 vSwitch0 “Service Console”
vmware-vim-cmd /hostsvc/net/portgroup_set –nicorderpolicy-active=vmnic0 vSwitch0 “Service Console 2”
vmware-vim-cmd /hostsvc/net/portgroup_set –nicorderpolicy-standby=vmnic2 vSwitch0 “Service Console 2”
vmware-vim-cmd /hostsvc/net/portgroup_set –nicorderpolicy-active=vmnic0 vSwitch0 “VMkVMotion-VLAN209”
vmware-vim-cmd /hostsvc/net/portgroup_set –nicorderpolicy-standby=vmnic2 vSwitch0 “VMkVMotion-VLAN209”

#adding Network Attached data store
/usr/sbin/esxcfg-nas -l
/usr/sbin/esxcfg-nas -a -o NAS1-ip -s /vol/vmw_datastore1 vmw_datastore1
/usr/sbin/esxcfg-nas -a -o NAS2-ip -s /vol/vmw_datastore2 vmw_datastore2
#/usr/sbin/esxcfg-nas -a -o NAS3-ip -s /vol/vol3_vmware_test nfs_vol_netapp
/usr/sbin/esxcfg-nas -l

#configure resolv.conf
/bin/cat /dev/null > /etc/resolv.conf
echo “nameserver ns1-ip” >> /etc/resolv.conf
echo “nameserver ns2.ip” >> /etc/resolv.conf
echo “search site.company.com” >> /etc/resolv.conf
cat /etc/resolv.conf

#configure hostname
vmware-vim-cmd hostsvc/net/dns_set –dns-hostname=esxXX
vmware-vim-cmd hostsvc/net/dns_set –dns-domainname=site.company.com

#configure NTP
/usr/sbin/esxcfg-firewall -e ntpClient
/usr/sbin/ntpdate -u ntp1.site.company.com
chkconfig –list ntpd
chkconfig –level 35 ntpd on
chkconfig –list ntpd
echo “restrict ntp1-ip mask 255.255.255.255 nomodify notrap noquery” >> /etc/ntp.conf
echo “server ntp1.site.company.com” >> /etc/ntp.conf
echo “restrict ntp2-ip mask 255.255.255.255 nomodify notrap noquery” >> /etc/ntp.conf
echo “server ntp2.site.company.com” >> /etc/ntp.conf
echo “restrict ntp3-ip mask 255.255.255.255 nomodify notrap noquery” >> /etc/ntp.conf
echo “server ntp3.site.company.com” >> /etc/ntp.conf
echo “driftfile /var/lib/ntp/drift” >> /etc/ntp.conf
echo “ntp1-ip” > /etc/ntp/step-tickers
echo “ntp2-ip” >> /etc/ntp/step-tickers
echo “ntp3-ip” >> /etc/ntp/step-tickers
service ntpd restart
hwclock –systohc

#configure SUDO

esxcfg-boot -g
esxcfg-boot -b

esxcfg-advcfg -s 32 /NFS/MaxVolumes

# make sure that NFS locks are not disabled
esxcfg-advcfg -s 0 /NFS/LockDisable

# this should already be set correctly, but just to make sure
esxcfg-advcfg -s 12 /NFS/HeartbeatFrequency

# this should also be set correctly already
esxcfg-advcfg -s 10 /NFS/HeartbeatMaxFailures

# increase the heap size. Default is 9.
esxcfg-advcfg -s 30 /Net/TcpIpHeapSize

# increase heap max. Default is 30.
esxcfg-advcfg -s 120 /Net/TcpIpHeapMax

#configure AD
/usr/sbin/esxcfg-auth –enablead –addomain=site.company.com –addc=DC-NAME.site.company.com
useradd IT1
useradd IT2
#useradd Administrator

#configure SNMP
/bin/cat /dev/null > /etc/snmp/snmpd.conf
echo “syscontact IT-TEAM-DL@company.com” >> /etc/snmp/snmpd.conf
echo “syslocation Company-Location” >> /etc/snmp/snmpd.conf
echo “rocommunity RO-String” >> /etc/snmp/snmpd.conf
echo “trapcommunity RO-String” >> /etc/snmp/snmpd.conf
echo “trapsink DELL-IT-Assistant-Server.site.company.com RO-String” >> /etc/snmp/snmpd.conf
echo “dlmod SNMPESX /usr/lib/vmware/snmp/libSNMPESX.so” >> /etc/snmp/snmpd.conf
echo “smuxpeer .1.3.6.1.4.1.674.10892.1” >> /etc/snmp/snmpd.conf

#install Dell OpenManage Agent
esxcfg-firewall -o 80,tcp,out,http
/usr/bin/lwp-download http://DELL-IT-Assistant-Server.site.company.com/OM_5.5.0_ManNode_A00.targz
tar -xvf OM_5.5.0_ManNode_A00.tar.gz
cd linux/supportscripts/
./srvadmin-install.sh -b -w -r -s
srvadmin-services.sh start
esxcfg-firewall -o 1311,tcp,in,OpenManageRequest

#test by going to https://esxXX.site.company.com:1311

# service mgmt-vmware restart # if needed

#end of script

procedure to find port by ip arp mac

Filed under: Uncategorized — Tags: , , , , , , — iben @ 14:21

procedure to find port by ip arp mac

Assumptions:
You have an IP address and want to find out what switch port it is on.
There is a core switch with edge switches and Cisco CDP is running.
Example: IP address is 10.1.1.69
– find the MAC address of this IP
open ssh console to core switch and run “sh arp”
coreswitch#sh arp | inc 10.1.1.69
Internet 10.1.7.69 0 0007.1234.cd43 ARPA Vlan5
– find port from MAC address
coreswitch#sh mac-address-table dynamic | inc 0007.1234.cd43
* 5 0007.1234.cd43 dynamic Yes 5 Gi7/12
– find edge switch for port
coreswitch#sh cdp nei gi7/12
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
edgeswitch.company.net
Gig 7/12 176 S I WS-C3560G-Gig 0/49
– open ssh console to edge switch and run “sh arp” repeat process

2009/04/13

NMAP tricks

Filed under: Uncategorized — Tags: , , , , — iben @ 22:49

How to use NMAP to count the number of hosts on a given subnet.

#!/bin/bash
echo 4192 > /proc/sys/net/ipv4/neigh/default/gc_thresh3
nmap -sP -PI $1 -n –max_rtt_timeout 5000 –initial_rtt_timeout 5000 | tail -1 | cut -f 2 -d “(” | cut -f 1 -d ” ” 2> /dev/null

(Thanks to Gabriel for this one!)

2009/04/08

NetApp A-SIS DeDuplication for VMware ESX Virtual Machines using NFS

Filed under: virtualization — Tags: , , , , , , — iben @ 21:06

I just wanted to share with you all. We are using a small NetApp with NFS for hosting ESX 3.5 Update 4 and ESX 4 RC Virtual Machines.

MODEL: FAS2020-R5
SW VERSION: 7.2.4L1

We have about 9 Windows VMs each one using about 20 GB disk space. There are Active Directory Domain Controllers, Exchange 2003 and 2007 servers, Windows Administration and Application servers and workstations and even Solaris 10 and Windows 2008 64 bit machines.

# du -h vmnfs/
21G vmnfs/vhq/dc1
21G vmnfs/vhq/dc2
21G vmnfs/vhq/vc
21G vmnfs/vhq/wadmin
8.6G vmnfs/vhq/w2008
91G vmnfs/vhq
31G vmnfs/eng/solaris10
31G vmnfs/eng
21G vmnfs/W2K3template
21G vmnfs/SW-Node01
21G vmnfs/SW-Node02

If we include the snapshots there is 1.6TB of data available and being served up with only 21GB of disk space being used!

> df -h /vol/vmnfs
Filesystem total used avail capacity Mounted on
/vol/vmnfs/ 400GB 21GB 378GB 5% /vol/vmnfs/

> df -sh /vol/vmnfs
Filesystem used saved %saved
/vol/vmnfs/ 21GB 160GB 88%

> man nfs
The disk space savings generated by the shared space is
shown in the saved column. The space used plus the space
saved would be the total disk space usage, if no space was
shared. The %saved is calculated as [saved / (used + saved)].

Below is a list of the maximum volume size for each storage system:

Storage system (with nearstor_option enabled) Max. A-SIS deduplication volume size
FAS6070, FAS6080, N7800 16TB
FAS6030, FAS6040, N7600 10TB
FAS3070, N5600 6TB
NearStore R200 4TB
FAS3040, N5300 3TB
FAS3050, N5500 2TB
FAS3020, N5200 1TB
FAS2050 1TB
FAS2020 0.5TB

You can use MRTG to graph the disk space saved by A-SIS deduplication by volume name.

http://www.usenet-forums.com/mrtg/392860-mrtg-mrtg-ntap-probe-release-0-5-0-sis-disk-space-savingsreport-added.html

What has your experience been with using A-SIS from NetApp with ESX hosts over NFS?

2009/04/07

VMware ESX setting static mac addresses

Filed under: Uncategorized — Tags: , , , , — iben @ 15:22

1. Select a static MAC. NOTE: Static MAC addresses must be in the range of 00:50:56:00:00:00-00:50:56:3F:FF:FF to work with this procedure.
2. Remember to record the Static MAC addresses registered for future reference.
3. Unregister vm:
4. Note the datastore, vm inventory folder, and name for the vm in the summary tab
5. Power down the virtual machine
6. Right click the vm and select remove from inventory
7. Edit vmx:
8. Ssh to the esx host system (use putty)
9. cd /vmfs/volumes/
10. cd to the system’s folder
11. cp .vmx to .vmx.bak
12. vi .vmx
13. find the ethernet0 section
14. make the following changes:
15. change ethernet0.addressType = “vpx” to ethernet0.addressType = “static”
16. ethernet0.generatedAddress = “00:50:56:01.01.00” to ethernet0.address = “00:50:56:01.01.00”
17. rearrange so the following items are in this order and grouped together: ethernet0.address, ethernet0.addresstype, uuid.location, uuid.bios
18. Write the changes to the disk and exit
19. Reregister the vm:
20. In virtual center, browse to the host datastore (configuration, storage, double click on the vm’s datastore)
21. Browse to the edited .vmx file
22. Right click the .vmx file and select Add to Inventory
23. Enter the system name
24. Select the host
25. Select the resource pool
26. Click Finish
27. Power on the vm and verify the mac address
28. Windows: ipconfig /all find “Physical Address”
29. Linux: ifconfig /a grep Hwaddr

EXAMPLE

ethernet0.address = “00:50:56:88:6f:98”

ethernet0.addressType = “static”

uuid.location = “56 4d 6b b4 70 cc 85 24-59 1b 2d 24 0a 2b d7 7a”

uuid.bios = “50 08 5b 0d e1 f7 fb 8b-ba 39 74 1b 30 fc 0c 40”

Posted by Jae Ellers at Monday, January 28, 2008.
http://vmprofessional.com/2008/01/setting-static-mac-addresses.html

This post rocks! Helped me out of a tight bind today.

ESX versus ESXi – feature comparison – Dell Open Manage

Filed under: virtualization — Tags: , , , , , , — iben @ 11:55

The following information was obtained from Dell’s web site:
http://support.dell.com/support/edocs/software/eslvmwre/Systems_Mngmnt/ESXi_MNGMNT/HTML/body.htm

Monitoring Comparison between ESX and ESXi

Systems Management
Feature Description: Inventory
Processor Information including brand, processor version, current speed, core count, model, stepping information, 64-bit support, HyperThreading (HT), Virtualization Technology (VT), Demand Based Switching (DBS), and Execute Disable (XD).
Cache information including status, level, max size, installed size, type, location, write policy, set associativity, and error correction.

ESX Classic
All of the above Inventory information is available through OpenManage Server Administrator.

Processor brand, processor version, current speed, core count, model, and stepping information is also available in IT Assistant

ESXi
Only Processor brand, processor version, current speed, core count, and model available using the VI Client.

2009/03/30

VMware ESX Cost Per GB Calculator

Filed under: virtualization — Tags: , , , , , , , — iben @ 09:51

I ran some numbers for a customer recently and discovered the single processor high-RAM hardware configurations can be more cost effective for most corporate windows applications hosted on VMware ESX. Keep in mind that the number of processors a server has doesn’t always need to equal the number of sockets.

This includes the cost of hardware, ESX Enterprise, and Microsoft Windows Data Center Edition.

http://spreadsheets.google.com/ccc?key=p0EnXM-6h5gbFTHB27ffELA

What did I miss in these calculations. There are also per port costs to include for Network, Storage, backup agents, etc.

NOTE: Recently updated to show HP blades with 16 GB DIMMS

Reference:
VMware’s Multi-Core Pricing & Licensing Policy
http://www.vmware.com/download/eula/multicore.html

VMware’s End User License Agreement
http://www.vmware.com/download/eula/virtualcenter.html
1.6 "Processor" means a single, physical chip that houses no more than six (6) processor cores.

2009/03/28

Monitoring Machine Setup Project

Filed under: Uncategorized — iben @ 23:37

CentOS 4.6 system setup
VMware Tools Installed
DAG yum repo configured
Install smokeping
http://lzheng.blogspot.com/2007/02/install-smokeping-via-yum.html
http://blogs.techrepublic.com.com/networking/?p=334&tag=rbxccnbtr1
http://oss.oetiker.ch/smokeping/pub/
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.1.tar.gz

tar xvzf smokeping-2.4.1.tar.gz
mv smokeping-2.4.1 /usr/local/smokeping
chown -R root:root /usr/local/smokeping

cd /usr/local/smokeping/bin
for foo in *.dist; do cp $foo `basename $foo .dist`; done

cd /usr/local/smokeping/etc/
for foo in *.dist; do cp $foo `basename $foo .dist`; done

cd /usr/local/smokeping/htdocs
for foo in *.dist; do cp $foo `basename $foo .dist`; done

# cpan
cpan> install HTTP::Request

Upgrade perl from 5.8.4 to 5.8.9
rpm -vhU http://downloads.activestate.com/ActivePerl/Linux/5.8/ActivePerl-5.8.9.825-i686-linux-glibc-2.3.2-288577.rpm

vi /usr/local/smokeping/bin/smokeping
change the first line to be as follows to reference latest version.
#!/opt/ActivePerl-5.8/bin -w

2009/03/25

Kensington Guardian Premium 6 Outlet Surge

Filed under: Uncategorized — Tags: , , , — iben @ 12:23

This is the best power strip for home and office.
Mfg. Part: 62132
CDW Part: 146408
UNSPSC: 39121610

No power switch. Eliminates accidental equipment power off events.
LED Power indicator. Tells you outlet is live.
Expand power options with six outlets and surge protection
Six outlets from a single electrical connection.
220 joules of protection guards equipment against spikes.
Peace of mind with up to $2,500 for replacing equipment damaged while connected.

6-outlet surge protector with a 5-foot power cord.
Guardian® Premium Strip is backed by the Kensington Limited Lifetime Warranty.
http://us.kensington.com/html/13265.html
http://www.cdw.com/shop/products/default.aspx?edc=146408

Cost: $12.00
Purchase 10 and they come in one box.

Pano Logic Cube Video Resolution Settings

Filed under: virtualization — Tags: , , , , , , , , , — iben @ 10:50

When logging into a PanoLogic virtual desktop console for the first time…

The default display resolution was 1024×768 standard 4:3 XGA

The HP w1707 LCD monitor has a native resolution of 1680×1050@60Hz 16:10 WSXGA+

Using the pano logic control panel I was only able to set the max resolution to 1440×900@69Hz 16:10 WSXGA

http://www.panologic.com/

List of Supported Reslutions: http://help.panologic.com/2.6/wwhelp/wwhimpl/js/html/wwhelp.htm#href=Introduction/Supported_Monitor_Resolutions.html

« Newer PostsOlder Posts »

Powered by WordPress