Ajcody-Virtualization: Difference between revisions

Line 59: Line 59:
** /vmfs/volumes/Storage vs. /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af
** /vmfs/volumes/Storage vs. /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af
* Setup /etc/hosts file on first vmimage to have entries for other machines
* Setup /etc/hosts file on first vmimage to have entries for other machines
* Configure first vmimage to use ESX server for DNS [/etc/resolv.conf] , NTP , and other network services
** Setup ESX for DNS, DHCP, NTP [below for more details]
* Configure vm configuration files, *.vmx , to use manual set MAC addresses and had last number matched number used in hostname.
* Configure vm configuration files, *.vmx , to use manual set MAC addresses and had last number matched number used in hostname.
* Configure ESX server to act as DNS & DHCP server using to auto-allocate ip address and hostnames and set each hostname to have proper A, PTR, and MX records using hostname of image equally domainname for mail.
* Configure ESX server to act as DNS & DHCP server using to auto-allocate ip address and hostnames and set each hostname to have proper A, PTR, and MX records using hostname of image equally domainname for mail.

Revision as of 01:04, 11 April 2010

Attention.png - This article is NOT official Zimbra documentation. It is a user contribution and may include unsupported customizations, references, suggestions, or information.

Virtualization Issues

Actual Virutalization Issues Homepage


Please see Ajcody-Virtualization

Vmware - ESX - Performance Resources


External resources:

Using VMWare ESX For ZCS Test Servers - How-To

References

References I ended up consulting to resolve and develope my notes below. There appears to be many alterations on how to do this depending on the version of the Vmware software you are using.

Introduction To Notes

I just did this and I plan on going through it and improving it once I have time.

  • I believe the hard coded reference to the volumes could use the sym-link for the path:
    • /vmfs/volumes/Storage vs. /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af
  • Setup /etc/hosts file on first vmimage to have entries for other machines
  • Configure first vmimage to use ESX server for DNS [/etc/resolv.conf] , NTP , and other network services
    • Setup ESX for DNS, DHCP, NTP [below for more details]
  • Configure vm configuration files, *.vmx , to use manual set MAC addresses and had last number matched number used in hostname.
  • Configure ESX server to act as DNS & DHCP server using to auto-allocate ip address and hostnames and set each hostname to have proper A, PTR, and MX records using hostname of image equally domainname for mail.
    • for example:
    • I would create three groups of images, if possible:
      • host.dev.DOMAIN.com
        • DEV is for pure testing
      • host.qa.DOMAIN.com
        • QA is for testing of changes prior to roll out to production
      • host.prod.DOMAIN.com
        • PROD would be replica's of production and used to test against production issues
    • Images configured as:
      • image hostname = centos5-30.dev.DOMAIN.com
      • server centos5-31.dev.DOMAIN.com has ip address of 192.168.0.31 - set A and PTR record
      • MX equals centos5-31.zimbra.DOMAIN.com / 192.168.0.31
    • Use more expansive descriptions in hostnames for standards and predictability.
      • Note, underscores ARE NOT vaild DNS hostnames per RFC 1034 - http://www.ietf.org/rfc/rfc1034.txt
      • Add the DEV - QA - PROD if your using that as well.
      • Primary Domain = example.com
        • LDAP Master hostname = ldap-1.example.com
        • LDAP Replica hostnames = ldap-2.example.com , ldap-3.example.com , etc.
        • First MTA hostname = mta-1.example.com
        • Other MTA hostnames = mta-2.example.com , mta-3.example.com , etc.
        • First Mailstore hostname = mailstore-1.example.com
        • Other Mailstore hostnames = mailstore-2.example.com , mailstore-3.example.com , etc.
      • On proxy server hostname =
        • Proxy on MTA's: mta-1.example.com , mta-2.example.com , etc.
          • Though the proxy package can be installed on other servers, usually it is installed on the mta's or on it's own.
        • Proxy on it's own: proxy-1.example.com , proxy-2.example.com , etc.
      • On archive [A&D] hostname:
        • First Archive hostname = archive-1.example.com
        • Other Archive hostnames = archive-2.example.com , archive-3.example.com , etc.
  • Configure proxy/firewall to be route point for primary domain and then pass to appropriate server for subdomain mail.
    • All external requess for *.zimbra.DOMAIN.com and zimbra.DOMAIN.com route to ESX server which in turns routes to appropriate vm server for subdomain.

The Notes

My Version of Vmware ESX does not have a cloning option - I was actually given the ESX box rebuilt. So here's what I did to 'clone' an image the manual way.

# Vmware ESX 4.0.0 Build 208167
# vSphere Client 4.0.0. Build 208111
#
# Copy some iso files to the server, here's is what I used. 
# Please note the vmx files below in my examples to my iso name for the centos dvd.
#   [ /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/iso/CentOS-5.4-i386-bin-DVD.iso ]
# Create your first VM - I called my Centos5-30 and that standard and naming convention is used throughout.
# I left the hostname just to use the localhost and installed the vmware tools.
# I then shutdown the image and did a snapshot of it.

pwd
  /vmfs/volumes

ls -la
  total 1024
  drwxr-xr-x 1 root root  512 Apr  9 23:59 .
  drwxrwxrwt 1 root root  512 Apr  9 00:39 ..
  drwxr-xr-t 1 root root 4200 Apr  9 23:20 4bbaf57f-6230127f-d432-00101849e4af
  lrwxr-xr-x 1 root root   35 Apr  9 23:59 Storage1 -> 4bbaf57f-6230127f-d432-00101849e4af

cd Storage1/

ls
  Centos5-30/      esxconsole-4bbb574e-eae0-2eb3-9d5b-00101849e4af/ 	iso/

ls iso/
  CentOS-5.4-i386-bin-DVD.iso                        openSUSE-11.2-DVD-i586.iso       ubuntu-8.04.4-desktop-i386.iso
  CentOS-5.4-x86_64-bin-DVD.iso                      openSUSE-11.2-DVD-x86_64.iso     ubuntu-8.04.4-server-amd64.iso
  openSUSE-11.2-Addon-NonOss-BiArch-i586-x86_64.iso  ubuntu-8.04.4-desktop-amd64.iso  ubuntu-8.04.4-server-i386.iso

vmware-cmd -l
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmx

pwd
  /vmfs/volumes/Storage1

# Make more directories for you to copy the initial image vitrual disks to

mkdir Centos5-31
mkdir Centos5-32
mkdir Centos5-33
mkdir Centos5-34
mkdir Centos5-35
mkdir Centos5-36
mkdir Centos5-37
mkdir Centos5-38
mkdir Centos5-39
mkdir Centos5-40
mkdir Centos5-41
mkdir Centos5-42
mkdir Centos5-43
mkdir Centos5-44
mkdir Centos5-45
mkdir Centos5-46
mkdir Centos5-47
mkdir Centos5-48
mkdir Centos5-49

# Now you'll do a copy operation of your first image to the new directories you made

vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-31/Centos5-31.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-32/Centos5-32.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-33/Centos5-33.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-34/Centos5-34.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-35/Centos5-35.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-36/Centos5-36.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-37/Centos5-37.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-39/Centos5-39.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-39/Centos5-39.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-40/Centos5-40.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-41/Centos5-41.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-42/Centos5-42.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-43/Centos5-43.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-44/Centos5-44.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-45/Centos5-45.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-46/Centos5-46.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-47/Centos5-47.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-48/Centos5-48.vmdk
vmkfstools -i /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmdk /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-49/Centos5-49.vmdk

pwd
  /vmfs/volumes/Storage1

# Now you'll copy the inital images configuration file to the directory above the image directories so we can modify it and make it a template file

cp Centos5-30/Centos5-30.vmx ./Centos5-31.vmx

vi Centos5-31.vmx
  change variables to be more generic

cat Centos5-31.vmx 
  #!/usr/bin/vmware
  .encoding = "UTF-8"
  config.version = "8"
  virtualHW.version = "7"
  pciBridge0.present = "TRUE"
  pciBridge4.present = "TRUE"
  pciBridge4.virtualDev = "pcieRootPort"
  pciBridge4.functions = "8"
  pciBridge5.present = "TRUE"
  pciBridge5.virtualDev = "pcieRootPort"
  pciBridge5.functions = "8"
  pciBridge6.present = "TRUE"
  pciBridge6.virtualDev = "pcieRootPort"
  pciBridge6.functions = "8"
  pciBridge7.present = "TRUE"
  pciBridge7.virtualDev = "pcieRootPort"
  pciBridge7.functions = "8"
  vmci0.present = "TRUE"
  nvram = "Centos5-31.nvram"
  deploymentPlatform = "windows"
  virtualHW.productCompatibility = "hosted"
  unity.customColor = "|23C0C0C0"
  tools.upgrade.policy = "useGlobal"
  powerType.powerOff = "soft"
  powerType.powerOn = "default"
  powerType.suspend = "hard"
  powerType.reset = "soft"
  displayName = "Centos5-31"
  extendedConfigFile = "Centos5-31.vmxf"
  floppy0.present = "TRUE"
  scsi0.present = "TRUE"
  scsi0.sharedBus = "none"
  scsi0.virtualDev = "lsilogic"
  memsize = "1024"
  scsi0:0.present = "TRUE"
  scsi0:0.fileName = "Centos5-31.vmdk"
  scsi0:0.deviceType = "scsi-hardDisk"
  ide1:0.present = "TRUE"
  ide1:0.clientDevice = "FALSE"
  ide1:0.deviceType = "cdrom-image"
  ide1:0.startConnected = "TRUE"
  floppy0.startConnected = "FALSE"
  floppy0.clientDevice = "TRUE"
  ethernet0.present = "TRUE"
  ethernet0.networkName = "VM Network"
  ethernet0.addressType = "generated"
  guestOSAltName = "Red Hat Enterprise Linux 5 (32-bit)"
  guestOS = "rhel5"
  uuid.location = "56 4d 41 ed 87 cc a2 03-77 97 48 8c 65 16 7e ed"
  uuid.bios = "56 4d 41 ed 87 cc a2 03-77 97 48 8c 65 16 7e ed"
  vc.uuid = "52 9e a1 5c 02 25 0f c2-20 03 f8 bb 21 93 74 c7"
  ethernet0.generatedAddress = ""
  tools.syncTime = "FALSE"
  cleanShutdown = "TRUE"
  replay.supported = "FALSE"
  sched.swap.derivedName = "/vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-31/Centos5-31-d6823091.vswp"
  scsi0:0.redo = ""
  vmotion.checkpointFBSize = "4194304"
  pciBridge0.pciSlotNumber = "17"
  pciBridge4.pciSlotNumber = "21"
  pciBridge5.pciSlotNumber = "22"
  pciBridge6.pciSlotNumber = "23"
  pciBridge7.pciSlotNumber = "24"
  scsi0.pciSlotNumber = "16"
  ethernet0.pciSlotNumber = "32"
  vmci0.pciSlotNumber = "33"
  ethernet0.generatedAddressOffset = "0"
  vmci0.id = "-876333085"
  hostCPUID.0 = "0000000b756e65476c65746e49656e69"
  hostCPUID.1 = "000106a500100800009ce3bdbfebfbff"
  hostCPUID.80000001 = "00000000000000000000000128100800"
  guestCPUID.0 = "0000000b756e65476c65746e49656e69"
  guestCPUID.1 = "000106a500010800809822010febfbff"
  guestCPUID.80000001 = "00000000000000000000000128100800"
  userCPUID.0 = "0000000b756e65476c65746e49656e69"
  userCPUID.1 = "000106a500100800009822010febfbff"
  userCPUID.80000001 = "00000000000000000000000128100800"
  evcCompatibilityMode = "FALSE"
  ide1:0.fileName = "/vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/iso/CentOS-5.4-i386-bin-DVD.iso"
  floppy0.fileName = "/dev/fd0"
  debugStub.linuxOffsets = "0xa356145,0xffffffff,0xfc052084,0xffffffff,0x0,0x0,0xa356150,0x0,0xa35616f,0x0,0xfc052088,0xffffffff,0x0,0x0"
  tools.remindInstall = "TRUE"
  sched.cpu.affinity = "all"
  sched.swap.hostLocal = "disabled"

# Now we'll copy this template to the other image directories

cp Centos5-31.vmx Centos5-31/Centos5-31.vmx
cp Centos5-31.vmx Centos5-32/Centos5-32.vmx
cp Centos5-31.vmx Centos5-33/Centos5-33.vmx
cp Centos5-31.vmx Centos5-34/Centos5-34.vmx
cp Centos5-31.vmx Centos5-35/Centos5-35.vmx
cp Centos5-31.vmx Centos5-36/Centos5-36.vmx
cp Centos5-31.vmx Centos5-37/Centos5-37.vmx
cp Centos5-31.vmx Centos5-38/Centos5-38.vmx
cp Centos5-31.vmx Centos5-39/Centos5-39.vmx
cp Centos5-31.vmx Centos5-40/Centos5-40.vmx
cp Centos5-31.vmx Centos5-41/Centos5-41.vmx
cp Centos5-31.vmx Centos5-42/Centos5-42.vmx
cp Centos5-31.vmx Centos5-43/Centos5-43.vmx
cp Centos5-31.vmx Centos5-44/Centos5-44.vmx
cp Centos5-31.vmx Centos5-45/Centos5-45.vmx
cp Centos5-31.vmx Centos5-46/Centos5-46.vmx
cp Centos5-31.vmx Centos5-47/Centos5-47.vmx
cp Centos5-31.vmx Centos5-48/Centos5-48.vmx
cp Centos5-31.vmx Centos5-49/Centos5-49.vmx

# You'll want to swap the references of the initial image name [ Centos5-30 ] to be the directories image name 

vi Centos5-31/Centos5-31.vmx 
vi Centos5-32/Centos5-32.vmx 
vi Centos5-33/Centos5-33.vmx 
vi Centos5-34/Centos5-34.vmx 
vi Centos5-35/Centos5-35.vmx 
vi Centos5-36/Centos5-36.vmx 
vi Centos5-37/Centos5-37.vmx 
vi Centos5-38/Centos5-38.vmx 
vi Centos5-39/Centos5-39.vmx 
vi Centos5-40/Centos5-40.vmx 
vi Centos5-41/Centos5-41.vmx 
vi Centos5-42/Centos5-42.vmx 
vi Centos5-43/Centos5-43.vmx 
vi Centos5-43/Centos5-43.vmx 
vi Centos5-44/Centos5-44.vmx 
vi Centos5-45/Centos5-45.vmx 
vi Centos5-46/Centos5-46.vmx
vi Centos5-47/Centos5-47.vmx
vi Centos5-48/Centos5-48.vmx
vi Centos5-49/Centos5-49.vmx

# Now we can register those new images and they'll show up in your vSphere Client

vmware-cmd Centos5-31/Centos5-31.vmx register
vmware-cmd Centos5-32/Centos5-32.vmx register
vmware-cmd Centos5-33/Centos5-33.vmx register
vmware-cmd Centos5-34/Centos5-34.vmx register
vmware-cmd Centos5-35/Centos5-35.vmx register
vmware-cmd Centos5-36/Centos5-36.vmx register
vmware-cmd Centos5-37/Centos5-37.vmx register
vmware-cmd Centos5-38/Centos5-38.vmx register
vmware-cmd Centos5-39/Centos5-39.vmx register
vmware-cmd Centos5-40/Centos5-40.vmx register
vmware-cmd Centos5-41/Centos5-41.vmx register
vmware-cmd Centos5-42/Centos5-42.vmx register
vmware-cmd Centos5-43/Centos5-43.vmx register
vmware-cmd Centos5-44/Centos5-44.vmx register
vmware-cmd Centos5-45/Centos5-45.vmx register
vmware-cmd Centos5-46/Centos5-46.vmx register
vmware-cmd Centos5-47/Centos5-47.vmx register
vmware-cmd Centos5-48/Centos5-48.vmx register
vmware-cmd Centos5-49/Centos5-49.vmx register

# Confirm they all are registered

vmware-cmd -l | sort
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-30/Centos5-30.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-31/Centos5-31.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-32/Centos5-32.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-33/Centos5-33.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-34/Centos5-34.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-35/Centos5-35.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-36/Centos5-36.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-37/Centos5-37.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-38/Centos5-38.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-39/Centos5-39.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-40/Centos5-40.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-41/Centos5-41.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-42/Centos5-42.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-43/Centos5-43.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-44/Centos5-44.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-45/Centos5-45.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-46/Centos5-46.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-47/Centos5-47.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-48/Centos5-48.vmx
  /vmfs/volumes/4bbaf57f-6230127f-d432-00101849e4af/Centos5-49/Centos5-49.vmx

# You'll see your images now in your vSphere Client. 
# When you first start them, do a console view of it because you'll see in that view 
# you need to select an option before it will start up.
# Choose :  "I copied it"
# Once image is running, login as root and within a shell confirm your network interface has
# an unique IP address as well as a unique MAC address for the interface
# You then might want to suspend the image at this point.
Jump to: navigation, search