Syslog HASHMAP

I’ve a customer who have several DataCenters in the vCenter and each DataCenter needs different Syslog-Server. With this script you should be able to set for each Datacenter different Syslog-Server.

#Map DC to log server:
 
$servermap = @{
 
    "DC1" = "tcp://syslog01.v-crew.int:514,tcp://syslog02.v-crew.int:514";
    "DC2" = "tcp://syslog03.v-crew.int:514,tcp://syslog04.v-crew.int:514";
    "DC3" = "tcp://syslog05.v-crew.int:514,tcp://syslog06.v-crew.int:514";
 
};
 
  
 
foreach ($vmhost in (Get-VMHost)) {
 
    $DC = (Get-Datacenter -VMHost $vmhost)
 
    echo $vmhost.Name 
 
    echo $servermap.($DC.Name)
 

    $syslog = $servermap.($DC.Name)
 
    Get-AdvancedSetting -Entity $vmhost -Name "SysLog.Global.loghost" | Set-AdvancedSetting -Value $syslog -Confirm:$false
 
    Write-Host "Restarting syslog daemon." -ForegroundColor Green
 
    $esxcli = Get-EsxCli -VMHost $vmhost -V2
 
    $esxcli.system.syslog.reload.Invoke()
 
    Write-Host "Setting firewall to allow Syslog out of $($vmhost)" -ForegroundColor Green
 
    Get-VMHostFirewallException -VMHost $vmhost | where {$_.name -eq 'syslog'} | Set-VMHostFirewallException -Enabled:$true
 
}

https://github.com/Vaiper/syslog-servermap/blob/master/syslog-servermap.ps1

We hope it helps some of you.

ESXi eigenes Image erstellen inkl. HP und FusionIO

Wer wie ich zur Zeit ein eigenes ESXi Image benötigt inkl. Software von HP und FusionIO, der kann diese kurze Anleitung vielleicht gebrauchen. Damit habe ich ein aktuelles ESXi 5.5 Image inkl. aktuelle HP Software und FusionIO Treiber erstellt und schon 10 ESXi-Server installiert. Herunterladen des Zip-Files von VMware Herunterladen der Software von FusionIO PowerCLI … Continue reading “ESXi eigenes Image erstellen inkl. HP und FusionIO”

Wer wie ich zur Zeit ein eigenes ESXi Image benötigt inkl. Software von HP und FusionIO, der kann diese kurze Anleitung vielleicht gebrauchen. Damit habe ich ein aktuelles ESXi 5.5 Image inkl. aktuelle HP Software und FusionIO Treiber erstellt und schon 10 ESXi-Server installiert.
Herunterladen des Zip-Files von VMware
Herunterladen der Software von FusionIO
PowerCLI öffnen und dahin wechseln wo das Zip-File liegt

PowerCLI C:\Users\User\Downloads> ls
Verzeichnis: C:\Users\User\Downloads
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 06.02.2015 11:51 333533064 ESXi550-201502001.zip
-a--- 22.10.2013 16:46 297072 libvsl-1.0.0-550-offline-bundle.3.2.6.1219.zip
-a--- 21.10.2013 14:51 1738984 scsi-iomemory-vsl-55L-3.2.6.1219-offline_bundle-1377365.zip

3. EsxSoftwareDepot hinzufügen

PowerCLI C:\Users\User\Downloads> Add-EsxSoftwareDepot .\ESXi550-201502001.zip
Depot Url
---------
zip:C:\Users\User\Downloads\ESXi550-201502001.zip?index.xml
PowerCLI C:\Users\User\Downloads> Add-EsxSoftwareDepot .\libvsl-1.0.0-550-offline-bundle.3.2.6.1219.zip
Depot Url
---------
zip:C:\Users\User\Downloads\libvsl-1.0.0-550-offline-bundle.3.2.6.1219.zip?index.xml
PowerCLI C:\Users\User\Downloads> Add-EsxSoftwareDepot .\scsi-iomemory-vsl-55L-3.2.6.1219-offline_bundle-1377365.
zip
Depot Url
---------
zip:C:\Users\User\Downloads\scsi-iomemory-vsl-55L-3.2.6.1219-offline_bundle-1377365.zip?index.xml

Hinzufügen des HP-Depots

PowerCLI C:\Users\User\Downloads> Add-EsxSoftwareDepot http://vibsdepot.hp.com/hpq/dec2014/index.xml
Depot Url
---------
http://vibsdepot.hp.com/hpq/dec2014/index.xml

EsxSoftwareDepot Überprüfen

PowerCLI C:\Users\User\Downloads> Get-EsxSoftwareDepot
Depot Url
---------
zip:C:\Users\User\Downloads\ESXi550-201502001.zip?index.xml
zip:C:\Users\User\Downloads\libvsl-1.0.0-550-offline-bundle.3.2.6.1219.zip?index.xml
zip:C:\Users\User\Downloads\scsi-iomemory-vsl-55L-3.2.6.1219-offline_bundle-1377365.zip?index.xml
http://vibsdepot.hp.com/hpq/dec2014/index.xml
PowerCLI C:\Users\User\Downloads> Get-EsxSoftwarePackage -Name esx-base
Name Version Vendor Creation Date
---- ------- ------ -------------
esx-base 5.5.0-2.55.2456374 VMware 22.01.2015 00...
PowerCLI C:\Users\User\Downloads> Get-EsxImageProfile | ft -Autosize
Name Vendor Last Modified Acceptance Level
---- ------ ------------- ----------------
ESXi-5.5.0-20150204001-standard VMware, Inc. 23.01.2015 03:45:57 PartnerSupported
ESXi-5.5.0-20150204001-no-tools VMware, Inc. 23.01.2015 03:45:57 PartnerSupported

Profile Clonen

New-EsxImageProfile -CloneProfile ESXi-5.5.0-20150204001-standard -Name ESXi-5.5.0-20150204001-HP-FusionIO -AcceptanceLevel PartnerSupported
Name Vendor Last Modified Acceptance Level
---- ------ ------------- ----------------
ESXi-5.5.0-20150204001-HP-F... XXX 23.01.2015 0... PartnerSupported

Hinzufügen der Softwarepakete

Add-EsxSoftwarePackage -ImageProfile ESXi-5.5.0-20150204001-HP-FusionIO -SoftwarePackage hp-ams,libvsl,hponcfg,hp-smx-provider,hpnmi,scsi-iomemory-vsl,hpbootcfg,hpssacli,hp-esxi-fc-enablement,char-hpilo | Select -ExpandProperty Depends

Überprüfen der SoftwarePakete

Get-EsxSoftwarePackage | where {$_.Vendor -eq "Hewlett-Packard" -or $_.Vendor -eq "Fusion-io" } | Format-Table -AutoSize
 
Name                  Version                          Vendor          Creation Date     
----                  -------                          ------          -------------     
libvsl                550.sdk.1.0.0-vsl.3.2.6.1219     Fusion-io       12.10.2013 00:19:09
hponcfg               5.0.0.4.4-0.2.434156             Hewlett-Packard 14.07.2014 18:49:14
hpnmi                 500.2.3.12-434156                Hewlett-Packard 20.02.2014 12:00:00
hp-smx-limited        500.03.06.00.21-434156           Hewlett-Packard 03.07.2014 04:00:36
hp-smx-limited        550.03.05.00.2-1198610           Hewlett-Packard 06.02.2014 06:51:53
scsi-iomemory-vsl     3.2.6.1219-1OEM.550.0.0.1198610  Fusion-io       12.10.2013 00:18:59
hpssacli              1.60.17.0-5.5.0.1198610          Hewlett-Packard 06.12.2013 05:02:25
hponcfg               5.5.0.04-00.13.2.1198610         Hewlett-Packard 03.04.2014 00:09:07
hp-smx-provider       500.03.06.00.23-434156           Hewlett-Packard 03.07.2014 04:08:48
hpssacli              2.0.23.0-5.0.0.377826            Hewlett-Packard 29.07.2014 17:29:11
hp-smx-provider       550.03.05.00.8-1198610           Hewlett-Packard 06.02.2014 07:26:33
hpbootcfg             5.5.0.02-00.00.11.1198610        Hewlett-Packard 27.11.2013 18:50:47
hpnmi                 550.2.3.5-1198610                Hewlett-Packard 31.10.2013 19:50:14
hp-esxi-fc-enablement 500.2.1.8-434156                 Hewlett-Packard 08.09.2014 19:44:41
hp-conrep             5.0.0.1-0.0.8.434156             Hewlett-Packard 14.07.2014 18:48:57
hpbootcfg             5.0.0.02-00.00.8.434156          Hewlett-Packard 27.11.2013 18:44:33
char-hpilo            500.9.0.2.3-1OEM.500.0.0.434156  Hewlett-Packard 31.03.2014 19:44:41
hptestevent           5.0.0.01-00.01.1.434156          Hewlett-Packard 31.10.2013 19:06:15
hp-ams                550.9.6.0-12.1198610             Hewlett-Packard 15.02.2014 18:58:47
char-hpcru            5.0.6.6-1OEM.500.0.0.434156      Hewlett-Packard 31.03.2014 19:44:41
char-hpcru            5.5.6.6-1OEM.550.0.0.1198610     Hewlett-Packard 31.03.2014 19:44:41
hp-ams                500.10.0.1-07.434156             Hewlett-Packard 09.09.2014 17:03:44
hp-esxi-fc-enablement 550.1.6.19-1198610               Hewlett-Packard 18.02.2014 19:44:41
hptestevent           5.5.0.01-00.01.4.1198610         Hewlett-Packard 31.10.2013 19:05:15
char-hpilo            550.9.0.2.3-1OEM.550.0.0.1198610 Hewlett-Packard 31.03.2014 19:44:41

Export des Images als Zip-File, das kann man super Benutzen um bestehende ESXi-Server zu aktualisieren.

Export-EsxImageProfile -ImageProfile ESXi-5.5.0-20150204001-HP-FusionIO -ExportToBundle -FilePath C:\Users\XXX\Downloads\ESXI-Image\rdy\ESXi-5.5.0-20150204001-HP-FusionIO-23022015.zip

Export des Image als ISO-File für eine Neuinstallation.

Export-EsxImageProfile -ImageProfile ESXi-5.5.0-20150204001-HP-FusionIO -ExportToIso -FilePath C:\Users\XXX\Downloads\ESXI-Image\rdy\ESXi-5.5.0-20150204001-HP-FusionIO-23022015.iso

Hoffe es Hilft
 
 
 

Informations about CPU- and RAM-HotPlug at VMs on VMware vSphere 5

Enable CPU-Hot Plug and RAM-Hot Add at Virtual machines on VMware vCenter 5 Update 12.02.2013 / Gabrie post in the comments a important extra info about Hot-Add and post the link to the blog from Duncan Epping: http://www.yellow-bricks.com/2012/01/16/enabling-hot-add-by-default-cc-gabvirtualworld/ it’s important to read this!!! vSphere Virtual Machine Administration, Chapter 8 “Configuring Virtual Machines”, Section “Change CPU Hot Plug Settings … Continue reading “Informations about CPU- and RAM-HotPlug at VMs on VMware vSphere 5”

Enable CPU-Hot Plug and RAM-Hot Add at Virtual machines on VMware vCenter 5
Update 12.02.2013 / Gabrie post in the comments a important extra info about Hot-Add and post the link to the blog from Duncan Eppinghttp://www.yellow-bricks.com/2012/01/16/enabling-hot-add-by-default-cc-gabvirtualworld/ it’s important to read this!!!
vSphere Virtual Machine Administration, Chapter 8 “Configuring Virtual Machines”, Section “Change CPU Hot Plug Settings in the … Client”, page 94.
cpu-and-ram-hot-add
Some conditions and requirements for CPU Hot Plug

  • If possible, use hardware version 8 virtual machines.
  • Hot-adding multicore virtual CPUs is supported only with hardware version 8 virtual machines.
  • Not all guest operating systems support CPU hot add.
  • To use the CPU hot-add feature with hardware version 7 virtual machines, set the Number of cores per socket to 1.
  • Adding CPU resources to a running virtual machine with CPU hot plug enabled disconnects and reconnects all USB passthrough devices connected to that virtual machine.
  • For Linux guest operating VMware Tools must be installed.
  • The virtual machine must powered off to configure he Hot CPU settings.
  • Hot remove of Memory is not supported.
  • Hot remove of CPU is not supported.

To enable new CPU after adding a new CPU. You can use this script:
Hot add cpu to supported Linux guestOS

#!/bin/bash
# William Lam
# http://engineering.ucsb.edu/~duonglt/vmware/
# hot-add cpu to LINUX system using vSphere ESX(i) 4.0
# 08/09/2009
for CPU in $(ls /sys/devices/system/cpu/ | grep cpu | grep -v idle)
do
CPU_DIR="/sys/devices/system/cpu/${CPU}"
echo "Found cpu: "${CPU_DIR}" ..."
CPU_STATE_FILE="${CPU_DIR}/online"
if [ -f "${CPU_STATE_FILE}" ]; then
STATE=$(cat "${CPU_STATE_FILE}" | grep 1)
if [ "${STATE}" == "1" ]; then
echo -e "t${CPU} already online"
else
echo -e "t${CPU} is new cpu, onlining cpu ..."
echo 1 > "${CPU_STATE_FILE}"
fi
else
echo -e "t${CPU} already configured prior to hot-add"
fi
done

Hot adding memory in Linux

ONLY for Suse Linux Enterprise Linux 11
Note: These instructions work for SLES OS. Other distributions may be different.
To enable acpi_memhotplug, run this command within the SLES virtual machine:

modprobe acpi_memhotplug

Using vSphere Client, edit the virtual machine settings to increase the memory assigned to the virtual machine. For more information, see Increasing the amount of memory assigned to a virtual machine (1004059).
Bring the memory online in /sys/devices/system/memory with the command:

echo online > /sys/devices/system/memory/memory[number]/state

Run this command to check the state of the memory, looking for memory that appears offline:

grep line /sys/devices/system/memory/*/state

If memory appears as offline, set it to online with the command:

echo online > /sys/devices/system/memory/memory[number]/state

Verify that you can see the extra memory with the command:

free -m

Expert Mode: PowerCLI

This Works when System is online, but need one “cold” start to enable this function.
Enable-MemHotAdd and Enable-vCpuHotAdd

Function Enable-MemHotAdd($vm){
$vmview = Get-vm $vm | Get-View
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$extra = New-Object VMware.Vim.optionvalue
$extra.Key="mem.hotadd"
$extra.Value="true"
$vmConfigSpec.extraconfig += $extra
$vmview.ReconfigVM($vmConfigSpec)
}
Function Enable-vCpuHotAdd($vm){
$vmview = Get-vm $vm | Get-View
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$extra = New-Object VMware.Vim.optionvalue
$extra.Key="vcpu.hotadd"
$extra.Value="true"
$vmConfigSpec.extraconfig += $extra
$vmview.ReconfigVM($vmConfigSpec)
}

 

Good information about hot-add cpu and memory can found here

 

Powershell Autosizing

Da ich zur Zeit ein bisschen mit Power Shell rumspiele und es mich sehr Nervt, wenn ich eine Ausgabe mache aber die Namen andauernd gekürzt werden, hier die Lösung für mein Problem Um die Anzeige bei diversen Ausgaben richtig anzuzeigen: Beispiel ohne Parameter:  Beispiel mit Parameter:   get-vm Admin-VM-* | ft -autosize

Da ich zur Zeit ein bisschen mit Power Shell rumspiele und es mich sehr Nervt, wenn ich eine Ausgabe mache aber die Namen andauernd gekürzt werden, hier die Lösung für mein Problem
Um die Anzeige bei diversen Ausgaben richtig anzuzeigen:
Beispiel ohne Parameter:

Beispiel mit Parameter:

 
get-vm Admin-VM-* | ft -autosize