Konfiguration eines ESX Servers

 

Installation

Partitions

Partitions und Grössen dokumentieren!/ genug gross (zB 40 GB)

/swap genug gross (zB 2 GB, mindestens 2x Console Memory)

/boot genug gross (zB 200 MB, mindestens 150 MBytes für ESX 3)Rest für VM (vmfs)

Konfiguration

MUI

Aufruf mit Browser: http://server. Anmeldung als Root für ESX Systemadministration, als vmadmin für Erstellen und Modifizieren von VMs, als vmuser für Betrieb.In MUI Swapfile gleich gross wie physikalisches Memory erstellen.Virtuelle Switches definieren.Alias “vmlocal” für vmfs Partition erstellenvmadmin Benutzer erstellen, Homedirectory auf /home/vmware setzen, (Erstellen und Ändern von VMs)

vmuser Benutzer erstellen, Homedirectory auf /home/vmware setzen (Remote Console, Power on/off) vmuser in vmadmin Gruppe aufnehmen

 

Console

Auf WS puTTY und WinSCP installieren.

In Console

chown -R vmadmin:vmadmin /home/vmware"

VMs als Benutzer vmadmin erstellen, .vmdk muss vmadmin als Owner habenVMs als Benutzer vmuser verwenden/vmimages erstellen,

chown -R vmadmin:vmadmin /vmimages

Hier werden ISO Images etc. gespeichert (als Benutzer vmadmin anmelden)

alias l='ls -lahG'

in /root/.bashrc einfügen

alias l='ls -lahG'

in /home/vmware/.bashrc einfügen

Zeitsynchronisation

Zeitzone einstellen

ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Zeit via NTP synchronisieren

1.) Log on to the console as the root user.

2.) Edit the file /etc/ntp.conf

The comments in ntp.conf explain the purpose of each section. Find the section titled

# --- OUR TIMESERVERS -----
  • Copy the existing restrict and server example lines:
# restrict mytrustedtimeserverip mask 255.255.255.255 nomodify notrap noquery
# server mytrustedtimeserverip
  • Remove the # character from the two newly copied lines so they are no longer treated as comments.
  • Update both the new lines with the host name of the NTP server. Repeat this section to add more time servers, if needed.

Note: There must be both a restrict and a server line in this section for each NTP server.

1.) Save the file.

2.) Edit the file /etc/ntp/step-tickers. In this file, list the host name of the NTP servers entered above.

3.) To see the offset (in seconds) between the local clock and the source clock, run:

ntpdate -q time_server_name_or_ip_address

Note: If the correction resulting from synchronizing the local clock with the time server is large enough, it could affect the operating systems or applications running in virtual machines when they synchronize their clocks with the ESX Server they are running on.

4.) To enable the ntp daemon to autostart when the server is rebooted, run:

chkconfig --level 345 ntpd on

5.) To (re)start it now without rebooting, run:

service ntpd restart

6.) To set the local hardware clock to the NTP synchronized local system time, run:

hwclock --systohc

7.) To watch the status of the ntpd process, run:

watch ntpq -p

Press Ctrl-c to stop watching the process. Note the information in the following columns:

  • The character in the first column indicates the quality of the source. * indicates the source is the current reference.
  • remote lists the IP address or host name of the source.
  • when indicates how many seconds have passed since the source was polled.
  • poll indicates the polling interval. This value increases depending on the accuracy of the local clock.
  • reach is an octal number that indicates reachability of the source. A value of 377 indicates the source has answered the last eight consecutive polls.
  • offset is the time difference between the source and the local clock in milliseconds. polls.

Note: As ntpd successfully polls NTP servers, the kernel automatically sets the hardware clock to the system clock time periodically. Run man hwclock. See the section “Automatic Hardware Clock Synchronization By the Kernel” for more information.

Zeitsynchronisation in VM

VMware Tools (ESX Version) komplett installieren.Windows Time Service (w32time) deaktivieren und stoppen. Zeitsynchronisation in VMware Tools ankreuzen. Zeitsynchronisation soll ausschliesslich über VMware Tools erfolgen.

VMware Usage Counters

Installieren: “vmkusagectl install”Anschauen: “http://<server>/vmkusage”

Backup der Konfiguration

vm-support laufen lassen, Resultatfile sichern (zB mit WinSCP)

Hardwareänderungen

PCI Karten geändert: “vmkpcicheck”, danach Reboot. PCI Slot wechseln gilt als HW-Änderung!

VM Konfiguration (Ethernet, SCSI, Memory etc.): “vmkpcidiy -i”, danach Reboot

VM kopieren

Imports und Exports von .vmdk Files (mit Konversion) von/zu vmfs2 Partitions sind nur als root User möglich. Daher Owner und Group nach dem Transfer anpassen (auf vmadmin setzen).

  • In MUI mit “Manage Files” können .vmdk von vmfs2 Partitions nach ext3 Partitions und umgekehrt kopiert werden. Dabei werden sie automatisch nach/von Exportformat (2 GByte Files ohne leere Blöcke) konvertiert.
  • Mit dem Commandline Tool “vmkfstools” können .vmdk ebenfalls konvertiert werden (import und export Funktionen).
  • vmkfstools -e destfile sourcefile, z.B.
vmkfstools -e /mnt/smb/server-c.vmdk /vmfs/vmlocal/server-c.vmdk
  • vmkfstools -i sourcefile destfile z.B.
vmkfstools -i /mnt/smb/server-c.vmdk /vmfs/vmlocal/server-c.vmdk
  • Transfer zwischen Windows Systemen und ext3 Partitions z.B. mit SFTP (WinSCP, keine 2 GByte Limite aber relativ langsam).
  • Mount von Windows Shares in ESX Console mit “smbmount” (Samba). Limite für Filegrösse bei 2 GBytes!
  • Leeres Directory erstellen z.B.
mkdir /mnt/smb
  • Mounten des remote Laufwerks z.B.
smbmount //server/share /mnt/smb -o username=user,workgroup=domain,password=pw
  • Unmount mit
umount /mnt/smb
  • Kopieren von Files zwischen ESX Servern mit SFTP aus Console oder via gemeinsames SAN LUN.

VM aufsetzen

  • Typischerweise ein .vmdk pro Windows Drive (d.h. server-c.vmdk, server-d.vmdk).
  • VM ab CD ISO Image aufsetzen und vorbereiten (Support Tools, Resource Kit, Windows Commander, Windows Time Service abstellen, VM Tools installieren und Zeitsynchronisation ankreuzen, Windows Einstellungen, Virenscanner, PC-Duo etc.). VM noch nicht in Domain aufnehmen sondern in Workgroup.
  • Falls nicht schon geschehen: vmxnet Ethernet Adapter statt vlance wählen (effizienter). IP Adresse via DHCP.
  • Falls gewünscht, VM beim Start von ESX automatisch starten lassen (Einstellen in MUI).

Templates

  • Sysprep in VM laufen lassen (zu finden zB auf Win2003 CD in \SUPPORT\TOOLS\DEPLOY.CAB)· VM abstellen
  • .vmdk File nach /vmimages oder gemeinsames SAN LUN exportieren und “TMPL” vor den Namen stellen.
  • .vmdk File von /vmimages oder gemeinsamem SAN LUN importieren und umbenennen.
  • VM erstellen und bestehendes .vmdk anhängen.
This entry was posted in Software, VMware. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.