This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Horario inicio de operaciones ## | |
| $abre = get-date -hour 8 -minute 0 -second 0 | |
| ## Horarios cierre de operaciones ## | |
| $cierre = get-date -hour 16 -minute 0 -second 0 | |
| $IOarray = Get-VM $MisVMs | Where {$_.PowerState -eq "PoweredOn"} | select name, | |
| @{N="IORead";E={[Math]::Round((($_ |Get-Stat -Stat virtualDisk.numberReadAveraged.average -Start $abre.adddays(-5) -finish $cierre.adddays(-1) |Measure-Object Value -Average).Average),2)}}, | |
| @{N="IOWrite";E={[Math]::Round((($_ |Get-Stat -Stat virtualDisk.numberWriteAveraged.average -Start $abre.adddays(-5) -finish $cierre.adddays(-1) |Measure-Object Value -Average).Average),2)}}, | |
| @{N="LatRead";E={[Math]::Round((($_ |Get-Stat -Stat virtualDisk.totalReadLatency.average -Start $abre.adddays(-5) -finish $cierre.adddays(-1) |Measure-Object Value -Average).Average),2)}}, | |
| @{N="LatWrite";E={[Math]::Round((($_ |Get-Stat -Stat virtualDisk.totalWriteLatency.average -Start $abre.adddays(-5) -finish $cierre.adddays(-1) |Measure-Object Value -Average).Average),2)}}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $uri = "https://identity.api.rackspacecloud.com/v2.0/tokens" | |
| $user = "user" | |
| $apiKey1 = "My-API-Key" | |
| $account = "account" | |
| $passcred = @{ | |
| "username"=$user | |
| "apiKey"=$apiKey1 | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Script que genera CSV con informacion de la configuracion de distintos elementos en una | |
| ## instalacion de vSphere (5.1/5.5). Pensada en que corra al terminar una instalacion o con | |
| ## cierta frecuencia para mantener actualizada la informacion del entorno vSphere. | |
| ## Archivos CSV que va a generar el reporte | |
| ## -> Reporte de VMs | |
| ## -> Reporte de discos virtuales y configuracion | |
| ## -> Configuracion de politicas en PortGroups | |
| ## -> Configuracion de red en PortGroups | |
| ## -> IP y funcionalidades en PortGroups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################### | |
| ## Reporte Snapshots ## | |
| ####################### | |
| ## Busca Snapshots con mas de 24 horas, si no encuentra termina script, en caso de | |
| ## encontrar Snapshot genera una tabla que pega en un TXT y envia anexado via correo | |
| ## electronico. | |
| ## Agrega SnapIn de VMware | |
| Add-PSSnapin VMware.VimAutomation.Core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Variables | |
| $nombre = "Mi_Instancia" | |
| $fecha = Get-Date -Format "yyMMdd-HHmm" | |
| $7dias = (Get-Date).addhours(-165) | |
| $instancia = Get-EC2Instance | select -expandproperty RunningInstance | ? {$_.Tag.Key -eq "Name" -and $_.Tag.Value -eq $nombre} | |
| $id = $instancia.InstanceId | |
| $discos = Get-EC2Volume | Where-Object {$_.Attachment.InstanceId -eq $id} | |
| ## Loop para generar snapshots de todos los volumenes EBS attachados a la instancia | |
| foreach( $disco in $discos ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $MyVMs = Get-VM | |
| foreach($VM in $MyVMs){ | |
| Get-VM $VM |Get-HardDisk | | |
| Format-Table @{Name="VM";Expression={$_.Parent};a="left"}, | |
| @{Name="Disco";Expression={$_.name};a="left"}, | |
| @{Name="Capacidad GB";Expression={"{0:N1}" -f $_.CapacityGB};a="right"}, | |
| @{Name="Formato";Expression={if ($_.StorageFormat -eq 'Thin') { "Thin" } else { "Thick" }};a="center"}, | |
| @{Name="RDM";Expression={if ($_.ExtensionData.backing.LunUuid -ne $null) { "Si" } else { "No" }};a="center"}, | |
| @{Name="Independiente";Expression={if ($_.Persistence -eq 'Persistent') { "No" } else { "Si" }};a="center"}, | |
| @{Name="Persistente";Expression={if ($_.Persistence -eq 'IndependentPersistent' -or 'Persistent') { "Si" } else { "No" }};a="center"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Variables de columna "Estado" ## | |
| $on = "Encendida" | |
| $off = "Apagada" | |
| ## Genera una lista de VM en todos los Jobs de respaldo (backup) ## | |
| $jobs = get-vbrjob | where {$_.jobtargettype -eq "backup"} | |
| $protected = $jobs.getobjectsinjob() | |
| $vmresp = $protected.name | |
| ## Crea la tabla con las VMs que no aparecen en la lista de VMs protegidas en alguno de los Jobs ## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## vSphere 5.5 + Veeam 8 | |
| ## Aqui y ahora =) | |
| $tiempo = Get-Date | |
| ## Buscamos en las ultimas 24 horas todas las VM creadas u OVA/OVF "deployed" | |
| $nuevasVM1 = Get-VIEvent -Start $tiempo.AddDays(-1) | where {$_.FullFormattedMessage -like "*created virtual machine*"} | |
| $nuevas1 = $nuevasVM1.Vm.Name | |
| ## Agregamos al job de respaldo $MiJob las VMs encontradas | |
| foreach ($vm1 in $nuevas1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ######################################### | |
| ## Reporte utilización VMs por horario ## | |
| ######################################### | |
| ## Nota 1: Los contadores "virtualDisk.numberReadAveraged.average" y | |
| ## "virtualDisk.numberWriteAveraged.average" requieren tener configurado | |
| ## el nivel "2" del Statistics Level en vCenter Server. | |
| ## Nota 2: Necesita existir previamente la ruta "c:\temp\" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################## | |
| ## Reporte Alarmas generadas en vCenter ## | |
| ########################################## | |
| ## Nota 1: Necesita existir previamente la ruta "c:\temp\" | |
| ## Nota 2: Unicamente reporta errores y warnings | |
| ## Nota 3: Las variables preconfiguradas del script suponen la creacion | |
| ## de un reporte con las alarmas de "1" día previo. |
OlderNewer