tag:blogger.com,1999:blog-23213808270832664652024-02-18T18:24:27.727-08:00VMwareZoran Marjanovichttp://www.blogger.com/profile/01414321033868045350noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-2321380827083266465.post-36046906841324970112016-03-14T18:09:00.001-07:002016-04-27T12:53:11.969-07:00vCenter VM Report<pre class="brush:php;">
#The script is executed from PowerCLI or PowerShell with PowerCLI module.
#It connects to a vCenter server and creates a CSV report in D:\ drive
#or you may set your preferred location.
#The output file is named "VM_Report_currentDate.csv.".
#The report lists VM names, Windows names (not FQDNs),
#IPv4 addresses and whatever is written in the Notes filed.
#Set the input value for vCenter variable to string.
param ([string] $VIServer)
Write-Host
Write-Host
#Get the vCenter server name if PowerCLI is already connected.
$VIServer = $global:DefaultVIServers.Name
#If not already connected to a vCenter server,
#prompt for vCenter Server FQDN or IP.
If ($VIServer -eq "")
{
$serverName = Read-Host 'Please enter the vCenter Server FQDN or IP address'
$VIServer = $serverName
#Connect to vCenter Server
Write-Host
Write-Host "Connecting to vCenter Server..."
Write-Host
Connect-VIServer $VIServer
}
Else {}
#Create a VM report including VM names, Windows computer names (not FQDN/DNS names),
#IPv4 addresses and comments from the Notes field. Sort by VM names.
Write-Host
Write-Host
Write-Host "Building VM report..."
Write-Host
$VMs = Get-VM
$i = 0
$Output = ForEach ($VM in $VMs)
{
$i++
Write-Progress -Activity "Creating VM report" -Status "Status:" -PercentComplete (($i/$VMs.count)*100)
"" | select @{Name = "VM Name"; Expression = {$VM.Name.ToLower()}},
@{Name = "Windows Name"; Expression = {$WinName = $VM.Guest.HostName -Split'\.' $WinName[0]}},
@{Name = "IP Address"; Expression = {$VM.Guest.IPaddress[0]}},
@{Name = "Group"; Expression = {$VM.Notes}}
}
#Set the output file format, location and date.
Write-Host
Write-Host "Creating report file..."
Write-Host
#Save the report and point the file location.
$Day = (Get-Date).Day
$Month = (Get-Date).Month
$Year = (Get-Date).Year
$File = "VM_Report_" + $Day + "." + $Month + "." + $Year + ".csv"
$Output | Sort-Object "VM Name" | Export-CSV -path "D:\$File" -NoTypeInformation
Write-Host
Write-Host "Your report is here: D:\$File"
</pre>
Zoran Marjanovichttp://www.blogger.com/profile/01414321033868045350noreply@blogger.com0tag:blogger.com,1999:blog-2321380827083266465.post-16328112867656004332014-11-06T17:57:00.000-08:002015-01-16T19:46:14.812-08:00Can't call method "configuration" on an undefined value at /usr/bin/vicfg-snmp line 248Configure SNMP on an ESXi 5.5 host through vMA:<br /><br />I tried to configure SNMP on an ESXi host, and didn't set a port and a community string for the target, so it returned a warning saying that the switch requires at least a community string and optionally a port (I assumed it would set the default port as it's set for the agent). Once the target and community string are set, the show switch returns a strange error. Basically, the target requires a port to be specified as well, but it cannot be corrected by re-setting the target info. Instead, we need to revert the SNMP agent configuration to factory default or set the port in snmp.xml file or recreate the xml file and set the full target info. <br /><br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLpulpwE56Cl0iCUaBbzQ_ylujtj0DacNflGJRDk06mdV9Up0nowuhqy07dC1zFuF3Zt3rSNUXtz3vYfO9vyTjGVtDP1oKNXku4lUwMZsWHicij6WQXkB4o8MDimXQ8VEeAyHbNsGppKUB/s1600/x4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLpulpwE56Cl0iCUaBbzQ_ylujtj0DacNflGJRDk06mdV9Up0nowuhqy07dC1zFuF3Zt3rSNUXtz3vYfO9vyTjGVtDP1oKNXku4lUwMZsWHicij6WQXkB4o8MDimXQ8VEeAyHbNsGppKUB/s1600/x4.jpg" height="320" width="296" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqp_Xi4jrhgx8ifGkOXP5GoEuClQByruUYBt2S9_1bm6gk0dMW-uT-I0npbwB7AfoY9_SayDwsG4AKL9dv5loGtCS5BzOVA4nNO6f_Mbhid9axfyFaKu1ShqWdzm29MjbCuxVbM89V-pyf/s1600/x5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqp_Xi4jrhgx8ifGkOXP5GoEuClQByruUYBt2S9_1bm6gk0dMW-uT-I0npbwB7AfoY9_SayDwsG4AKL9dv5loGtCS5BzOVA4nNO6f_Mbhid9axfyFaKu1ShqWdzm29MjbCuxVbM89V-pyf/s1600/x5.jpg" height="172" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrj61N3XwIh0Dz8WW5eryrqqwi3Ob8OTm5-S2JN6aPANG6KbCOaynRftbszWXF9X1Zqt4-UJiZulx9jx-wOqFcwdIrAuzZZXuz_v-DEmsOsZaXuZoNH-IzsgK8isN6PZEAoReAXspeWN5T/s1600/x6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrj61N3XwIh0Dz8WW5eryrqqwi3Ob8OTm5-S2JN6aPANG6KbCOaynRftbszWXF9X1Zqt4-UJiZulx9jx-wOqFcwdIrAuzZZXuz_v-DEmsOsZaXuZoNH-IzsgK8isN6PZEAoReAXspeWN5T/s1600/x6.jpg" height="74" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTPaMs2_6dDk1VvphtS1AAxLqbDg0mrOWLIxlznXaOelujUl_BJg8xTicyRTK9c8S7J6J6STI5gGy6P55f8hyphenhyphenH9HPJiMhj6vXOLvukcedBVfoQlHVx2SaD_7OjmgUHmumxYQVtByOBc_Pv/s1600/x7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTPaMs2_6dDk1VvphtS1AAxLqbDg0mrOWLIxlznXaOelujUl_BJg8xTicyRTK9c8S7J6J6STI5gGy6P55f8hyphenhyphenH9HPJiMhj6vXOLvukcedBVfoQlHVx2SaD_7OjmgUHmumxYQVtByOBc_Pv/s1600/x7.jpg" height="65" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisxfc_7ORcktWrOAZKhCQfocuXXen73oj-5bI9KD5HOrhQdXpbNZLQj1XwaoaHTuG83UGrMmZNlAORc01uqxj9ZRAyJdVlMDmeNrAIBCxQB99mW9kBuYpWtL20SczthlQiRA4lzjQYB1hT/s1600/x8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisxfc_7ORcktWrOAZKhCQfocuXXen73oj-5bI9KD5HOrhQdXpbNZLQj1XwaoaHTuG83UGrMmZNlAORc01uqxj9ZRAyJdVlMDmeNrAIBCxQB99mW9kBuYpWtL20SczthlQiRA4lzjQYB1hT/s1600/x8.jpg" height="87" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6IoSg03apTcqqPhIafmV14nDUSfEP-3IBCJJa9TZjClwguJWr1TZ7SoLYVMtiwvfFR5jkJLxCoptODGobvqSyFZ5VjLw6zRk-bc8DiPk5SpfBWESJgNIC8twUZ5jJvkXYEKxhXJI-ajhg/s1600/x9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6IoSg03apTcqqPhIafmV14nDUSfEP-3IBCJJa9TZjClwguJWr1TZ7SoLYVMtiwvfFR5jkJLxCoptODGobvqSyFZ5VjLw6zRk-bc8DiPk5SpfBWESJgNIC8twUZ5jJvkXYEKxhXJI-ajhg/s1600/x9.jpg" height="44" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br /></div>Log on to the host through WinSCP and edit /etc/vmware/snmp.xml:<br /><br /><div class="MsoNormal"><?xml version="1.0" encoding="ISO-8859-1"?></div><div class="MsoNormal"><config><snmpSettings><enable>true</enable><port>161</port><syscontact></syscontact><syslocation></syslocation><EnvEventSource>indications</EnvEventSource><communities>123123</communities><targets><span style="color: red;">192.168.1.61</span></targets><engineid>00000063000000a100000000</engineid><loglevel>info</loglevel><authProtocol></authProtocol><privProtocol></privProtocol></snmpSettings></config></div><div class="MsoNormal"><br /></div>The KBA <a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2036910" target="_blank">Cannot enable or test SNMP on a VMware ESXi 5.1 host (2036910)</a> says:<br /><br /><i>In the targets section, set an IP Address to which the SNMP traps are to be sent. Alternatively, if you do not want an extra traffic on the network, set a loop-back address. </i><br /><br /><i>For example:</i><br /><targets></targets><br /><div class="MsoNormal"><targets></div><div class="MsoNormal">192.168.1.61<span style="color: red;">@162 123123</span></div><div class="MsoNormal"></targets></div><br /><div class="MsoNormal">So, if we now try to add a port and community string to the target, it returns another error: </div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ_4a2HxCiRHR4eTRqNPEmUysX-mnnw-K1md0LM5pWyDluSKHj_aZn0DF7V-jQkgViXOp6r1IxqvlOuVBR9TOEKG4HFbvbX9XvR4tVjU5fm3_9EcgkXMpsNnbrKQPXnEKLmrV_KOwvM4TZ/s1600/x1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ_4a2HxCiRHR4eTRqNPEmUysX-mnnw-K1md0LM5pWyDluSKHj_aZn0DF7V-jQkgViXOp6r1IxqvlOuVBR9TOEKG4HFbvbX9XvR4tVjU5fm3_9EcgkXMpsNnbrKQPXnEKLmrV_KOwvM4TZ/s1600/x1.jpg" height="86" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br /></div>So we can either reset the agent configuration to factory default with the switch –r, add a port and community string in the xml file, or rename or delete the xml file and configure the agent again:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOrtPAL9MOCbIPGDTyBvYqSii9vP4Hsq-buMHt1YWa-r20sRHsDa7TQTuZJAvwGtKp_v_dOxfl_CBBqSxNdT9NLlpD7mZKzusTH3IwwL1c4VyeGsGuVRfiiKpIJfZOowlaa-CAw6Ven6sp/s1600/11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOrtPAL9MOCbIPGDTyBvYqSii9vP4Hsq-buMHt1YWa-r20sRHsDa7TQTuZJAvwGtKp_v_dOxfl_CBBqSxNdT9NLlpD7mZKzusTH3IwwL1c4VyeGsGuVRfiiKpIJfZOowlaa-CAw6Ven6sp/s1600/11.jpg" height="223" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br /><div class="MsoNormal" style="mso-layout-grid-align: none; tab-stops: 48.0pt 96.0pt 144.0pt 192.0pt 240.0pt 288.0pt 336.0pt 384.0pt 432.0pt 480.0pt 528.0pt 576.0pt 624.0pt 672.0pt 720.0pt 768.0pt 816.0pt 864.0pt 912.0pt 960.0pt 1008.0pt 1056.0pt 1104.0pt 1152.0pt 1200.0pt 1248.0pt 1296.0pt 1344.0pt 1392.0pt 1440.0pt 1488.0pt 1536.0pt; text-autospace: none;"><span lang="DE" style="font-family: "Lucida Console"; font-size: 10.0pt; mso-ansi-language: DE; mso-bidi-font-family: "Lucida Console";"><?xml version="1.0" encoding="ISO-8859-1"?></span></div><div class="MsoNormal" style="mso-layout-grid-align: none; tab-stops: 48.0pt 96.0pt 144.0pt 192.0pt 240.0pt 288.0pt 336.0pt 384.0pt 432.0pt 480.0pt 528.0pt 576.0pt 624.0pt 672.0pt 720.0pt 768.0pt 816.0pt 864.0pt 912.0pt 960.0pt 1008.0pt 1056.0pt 1104.0pt 1152.0pt 1200.0pt 1248.0pt 1296.0pt 1344.0pt 1392.0pt 1440.0pt 1488.0pt 1536.0pt; text-autospace: none;"><span lang="DE" style="font-family: "Lucida Console"; font-size: 10.0pt; mso-ansi-language: DE; mso-bidi-font-family: "Lucida Console";"><config><snmpSettings><enable>true</enable><port>161</port><syscontact></syscontact><syslocation></syslocation><EnvEventSource>indications</EnvEventSource><communities>123123</communities><targets><span style="color: red;">192.168.1.61@162/123123</span></targets><engineid>00000063000000a100000000</engineid><loglevel>info</loglevel><authProtocol></authProtocol><privProtocol></privProtocol></snmpSettings></config></span><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn_d30SxPNuexLrtOghTuCvYmMcZLtVnMK7R-8ojwUGGoVw24opQEE6IR6JAbZRJtO4OU59A8W7i47uzaNty8o53heaBqJ7jkRh3-0kE0M6LdgfmTFxuovQFFT8SZQbwBOwaiVobFunjmo/s1600/x3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn_d30SxPNuexLrtOghTuCvYmMcZLtVnMK7R-8ojwUGGoVw24opQEE6IR6JAbZRJtO4OU59A8W7i47uzaNty8o53heaBqJ7jkRh3-0kE0M6LdgfmTFxuovQFFT8SZQbwBOwaiVobFunjmo/s1600/x3.jpg" height="49" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div></div> <br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4TPT3Y5_CLFpb-KHSGeuU_TBGpUSN43bZyDYnUmtI6IqcYa5J44C9nP-lM83JexzgTF6v19t10YnUmJqCRk46HZqT-wXFAF0nX_qgENPaKYX1up6T4k-4LPe3lSoHtSI4r3ziN-ZL5Dmr/s1600/x2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4TPT3Y5_CLFpb-KHSGeuU_TBGpUSN43bZyDYnUmtI6IqcYa5J44C9nP-lM83JexzgTF6v19t10YnUmJqCRk46HZqT-wXFAF0nX_qgENPaKYX1up6T4k-4LPe3lSoHtSI4r3ziN-ZL5Dmr/s1600/x2.jpg" height="203" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><br />So the target port number is required when setting an SNMP target.<br /><br />Zoran Marjanovichttp://www.blogger.com/profile/01414321033868045350noreply@blogger.com0tag:blogger.com,1999:blog-2321380827083266465.post-9881619140766408052012-06-27T03:06:00.000-07:002015-01-16T19:46:14.824-08:00VMs showing on 2 storage locations after being migrated between storagesAfter migrating several virtual machines in vSphere v5.0, they were showing at 2 storage locations, the source and destination one. However, at the source location, the used space was showing as 0. </br></br> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMCzbhqmCxlkm4aCT74uMhWNKF1scgSbqV4P5r3nyABusnN5QrsvsMtFI8vdUk72vbN9aR8FZ_BP1d_UPVEMMph7PhSPfA37MxpllKKBh7o1OvE5kGMwZ2HW0zo1HHjmQNmvPc2Tt5c3AA/s1600/used_space_0_B.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMCzbhqmCxlkm4aCT74uMhWNKF1scgSbqV4P5r3nyABusnN5QrsvsMtFI8vdUk72vbN9aR8FZ_BP1d_UPVEMMph7PhSPfA37MxpllKKBh7o1OvE5kGMwZ2HW0zo1HHjmQNmvPc2Tt5c3AA/s320/used_space_0_B.jpg" width="274" /></a> </br></br> The VMs migrated successfully and they were up and running without any issues. It turned out that an ISO file was attached to these VMs. Once the file was removed, the old storage disappeared.Zoran Marjanovichttp://www.blogger.com/profile/01414321033868045350noreply@blogger.com0tag:blogger.com,1999:blog-2321380827083266465.post-62374981944896307692012-05-07T04:10:00.000-07:002015-01-16T19:46:14.820-08:00Reporting on storage used by VMware virtual machinesHere is a very useful freeware tool for creating reports on VMware virtual machines’ storage usage per drive. The tool is called MCS StorageView and is made by Mightycare. It can be downloaded from <a href="http://www.mightycare.de/downloads/mcs_storageview">here</a>.<br /><br />Download it and run the exe, then connect to the vCenter server (Connect > Login). Once connected, it will start populating the table. To save the report in a csv file, click Export2CSV.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjtwg1DXJNYoqH9hewPavbkK5GueCNQj6gstJtZf83Ll4AeYJ9DLcfMjCU6XdjLxpI_OKSu3LjPfkvXEZieIi1dl_KwTh3LgpcvwojRrU35Ll69aJXSim7tmMYKUiJ7MPlp78Q7hxA6vex/s1600/original_report.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="135" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjtwg1DXJNYoqH9hewPavbkK5GueCNQj6gstJtZf83Ll4AeYJ9DLcfMjCU6XdjLxpI_OKSu3LjPfkvXEZieIi1dl_KwTh3LgpcvwojRrU35Ll69aJXSim7tmMYKUiJ7MPlp78Q7hxA6vex/s320/original_report.jpg" width="320" /></a></div><br />I was after total allocated and used space per drive in order to know how much was used per drive type (e.g. all prod system drives, all test database drives, log drives, apps drives etc). It is easy to organise the list per drives and calculate the used space:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjylbnUVusbWsIUUmy18-X_vVlQBJSMJun9A8d_8NIIrnIhqDuwm-jeaNYkf3Rwnts-xBF43LoDnMOlIxZMfSrI4B7Y0oVI_SlUQV6oeogpS7BgYkJ9-1n-KPRWbpb4baCyYjUmLKYhjvFs/s1600/calculate_used_space.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjylbnUVusbWsIUUmy18-X_vVlQBJSMJun9A8d_8NIIrnIhqDuwm-jeaNYkf3Rwnts-xBF43LoDnMOlIxZMfSrI4B7Y0oVI_SlUQV6oeogpS7BgYkJ9-1n-KPRWbpb4baCyYjUmLKYhjvFs/s320/calculate_used_space.jpg" width="320" /></a></div><br />And then get totals for all drives:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ8cgXnt4KtuM8DH34QyWpdg4eFXpZN3DWwxZ-2doRPuaGQPW7hVWowezsgHB0xyBfc5sMgN3wUTHcdRHXLlU9Us0gttbv9zTejKiwvme3JW0qnbCBxwE_k7UMlTZHZp6ZXNWFly627_kk/s1600/totals.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="57" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ8cgXnt4KtuM8DH34QyWpdg4eFXpZN3DWwxZ-2doRPuaGQPW7hVWowezsgHB0xyBfc5sMgN3wUTHcdRHXLlU9Us0gttbv9zTejKiwvme3JW0qnbCBxwE_k7UMlTZHZp6ZXNWFly627_kk/s320/totals.jpg" width="320" /></a></div><br />If you have multiple environments (prod, dev, test, staging etc), it’s easy to separate the VMs and calculate the totals per environment.Zoran Marjanovichttp://www.blogger.com/profile/01414321033868045350noreply@blogger.com0tag:blogger.com,1999:blog-2321380827083266465.post-5188266379771016452011-12-20T21:56:00.000-08:002015-01-16T19:47:02.447-08:00Migrating VMware vCenter Server 4.1 and Update Manager databases from MS SQL 2005 to MS SQL 2008 R2Migrating VMware vCenter Server 4.1 and Update Manager databases from MS SQL 2005 to MS SQL 2008 R2:<br />
<br />
1. Backup the vCenter, Update Manager and system databases<br />
2. Stop the following services on the vCenter server: <br />
VMware vCenter Update Manager Service<br />
VMware VirtualCenter Management Webservices<br />
VMware VirtualCenter Server<br />
3. Detach the vCenter and Update Manager databases, drop connections<br />
4. Copy the databases and their logs to the new SQL server<br />
5. Create a login for the vCenter account (and for the Update Manager account if it is different from the vCenter account) on the new SQL server<br />
6. On the new SQL server, grant the vCenter account the db_owner permission over the MSDB system database<br />
7. Attach the vCenter and Update Manager databases to the new SQL server<br />
8. On the new SQL server, grant the vCenter account the db_owner permission over the vCenter database and the Update Manager account (if it is different from the vCeneter account) the db_owner permission over the Update Manager database<br />
9. Install Microsoft SQL Server 2008 R2 Native Client (v10.50.1600.1) on the vCenter server. The old client can stay, but if you want to remove it, remove the existing DSN first.<br />
10. Create new DSNs using the new driver<br />
<br />
- For vCeneter open: C:\windows\system32\odbcad32.exe (this is 64-bit version) and chose SQL Server Native Client 10.0<br />
Specify the new SQL server as the database server<br />
Make sure the default database is set to the vCenter database <br />
Test the connection<br />
<br />
- For Update Manager open: C:\windows\SysWOW64\odbcad32.exe (this is 32-bit version) and chose SQL Server Native Client 10.0<br />
Specify the new SQL server as the database server<br />
Make sure the default database is set to the vCenter database <br />
Test the connection<br />
<br />
11. Start the services from the step 2<br />
12. Create the SQL Agent rollup jobs. The scripts are located on the vCenter server in C:\Program Files\VMware\Infrastructure\VirtualCenter Server<br />
13. Set the vCenter account to be the owner of all the vCenter jobs<br />
14. For any issues, check the logs under C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\Logs<br />
<br />
<br />
<a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021804">Location of vCenter Server log files</a><br />
<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms712362%28v=vs.85%29.aspx">Managing Data Sources</a> <br />
<a href="http://www.microsoft.com/download/en/details.aspx?id=16978">Microsoft® SQL Server® 2008 R2 Feature Pack</a><br />
<a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=7960893">Moving the vCenter Server SQL database</a><br />
<a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1022104">Upgrading to ESX 4.1 and vCenter Server 4.1 best practices</a>Zoran Marjanovichttp://www.blogger.com/profile/01414321033868045350noreply@blogger.com0