ESXi 4.1 Lockdown Modes

I came across a great video by David Davis at VMwareVideos.com about ESXi 4.1 Lockdown Mode and the new Total Lockdown Mode.  ESXi lockdown mode is designed to put a layer of security at the local host level and require that the host be managed only through vCenter.  David points out that you can go even further in locking down the local host access with the Total Lockdown Mode which completely disables the DCUI.  I am not 100% sure that this is best suited for me but I guess I could see some possible applications of this mode.

Check out the video here.

Sourced from:  VMwareVideos.com

vApps: To use or not to use?

Back in September, Cody Bunch at ProfessionalVMware.com, had posted an article regarding an e-mail he had received from one of his readers about vApps.  Besides the fact that it was a good read, I have found that vApps are extremely nice for use when deploying multi-tiered applications and organization.  Per VMware, a vApp can be defined as:

A vApp, uses the OVF standard to hold information about your multi-tier application. That is, it will hold information about service levels, policies, security, as well as the components of the application (read: VM or VMs). Containing all of this information will allow the owner of the vApp to move between internal and external clouds

What are your thoughts on vApps and how they can be used?  Sound off in the comments!

Sourced from:  ProfessionalVMware.com

Datastore Size Reporting via PowerCLI Script

After pulling together some different resources from the likes of Alan Renouf, Luc Dekens, Eric Sloof, and others in the PowerCLI community (Forgive me if I didn’t mention all but I read through a lot of different people’s posts!), I have pieced together something that I use regularly to report datastore sizes and amounts of free space.  All sent to you in a nice HTML e-mail.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@"
===============================================================================
Title:             Report-Datastores.ps1
Description:     Report Datastore usage for all Datastores managed by vCenter
Requirements:     Windows Powershell and the VI Toolkit
Usage:            .\Report-Datastores.ps1
===============================================================================
"
@

#Global Functions
#This function generates a nice HTML output that uses CSS for style formatting.
function Generate-Report {
    Write-Output "<html><head><title></title><style type=""text/css"">.Error {color:#FF0000;font-weight: bold;}.Title {background: #0077D4;color: #FFFFFF;text-align:center;font-weight: bold;}.Normal-left {text-align:left;}.Normal {text-align:right;}</style></head><body><table><tr class=""Title""><td colspan=""4"">VMware Datastore Report</td></tr><tr><td>Datastore  </td><td>Capacity(GB)  </td><td>Used(GB)  </td><td>% Free  </td></tr>"
 
                Foreach ($store in $report){
                    Write-Output "<td class=""Normal-left"">$($store.name)</td><td class=""Normal"">$($store.CapacityGB)</td><td class=""Normal"">$($store.UsedGB)</td><td class=""Normal"">$($store.PercFree)</td></tr> "
                }
        Write-Output "</table></body></html>"
    }

#Login details
$username = 'changeme'
$password = 'supersecret'

#Current, Previous, Difference File information
$digits = 2
$Folder = 'C:\Reports'

#List of servers including Virtual Center Server.  The account this script will run as will need at least Read-Only access to Cirtual Center
$VIServer = "vc1.example.net"    #Chance to DNS Names/IP addresses of your ESXi servers or Virtual Center Server

#Initialise Array
$Report = @()

# Connect to Virtual Center
$VC = Connect-VIServer $VIServer -user $username -password $password

# Get all datastores and put them in alphabetical order
#$datastores = Get-Datastore | Sort-Object Name

#Get all datastores and put them in alphabetical order
        foreach ($server in $serverlist){
        
        # Check is server is a Virtual Center Server and connect with current user
        if ($server -eq "VCServer"){Connect-VIServer $VIServer}
        
        # Use specific login details for the rest of servers in $serverlist
        else {Connect-VIServer $VIServer -user $username -password $password}
        
        
        Get-Datastore | Sort-Object Name | %{
            $Store = {} | Select Name, CapacityGB, UsedGB, PercFree
            $Store.Name = $_.name
            $Store.CapacityGB = [math]::Round($_.capacityMB/1024,$digits)
            $Store.UsedGB = [math]::Round(($_.CapacityMB - $_.FreeSpaceMB)/1024,$digits)
            $Store.PercFree = [math]::Round(100*$_.FreeSpaceMB/$_.CapacityMB,$digits)
            $Report += $Store
                                }
        # Disconnect from Virtual Center
        Disconnect-VIServer -Confirm:$False
        }
                                        
# Disconnect from Virtual Center
Disconnect-VIServer -Confirm:$False

# Generate the report and email it as a HTML body of an email
Generate-Report > "$Folder\Report-Datastore.html"
    IF ($Report -ne ""){
    $SmtpClient = New-Object system.net.mail.smtpClient
    $SmtpClient.host = "my.smtp.host"   #Change to a SMTP server in your environment
    $MailMessage = New-Object system.net.mail.mailmessage
    $MailMessage.from = "System.Automation@example.com"   #Change to email address you want emails to be coming from
    $MailMessage.To.add("yomomma@example.com")    #Change to email address you would like to receive emails.
    $MailMessage.IsBodyHtml = 1
    $MailMessage.Subject = "VMware Datastore Report"
    $MailMessage.Body = Generate-Report
    $SmtpClient.Send($MailMessage)}

Rescan All HBA’s from PowerCLI

Over at Professional VMware, Cody Bunch posts a pretty useful PowerCLI one-liner to rescan all HBA’s.

Get-VMHost | Get-VMHostStorage -RescanAllHba

Figured this would be nice to share!

Sourced from: Professional VMware

« Previous Entries Next Entries »