Script to see Datastore Permission

Last day in the VMware Community I saw a request for:

“I have AD group like mydomain\mygroup.

This group have access for many datastores.

How i can use powercli to get full list of datastores which the group can manage?”

I made this PowerCLI script:

$cred = Get-Credential
Connect-ViServer <vcenter-FQDN>; -Credential $cred
$datastores = Get-Datastore | Select Name
$groupAD = "domain\group"
$report = @()
foreach ($datastore in $datastores) {
  $report +=  Get-VIPermission
| Where-Object {($_.Entity.Name -Like $datastore.Name) -and ($_.Principal -eq $groupAD)} |Select Principal,Role,@{n='Datastore';E={$datastore.Name}},@{n='Entity';E={$_.Entity.Name}},@{N='Entity Type';E={$_.EntityId.Split('-')[0]}},@{N='vCenter';E={$_.Uid.Split('@:')[1]}}
}
$report | Export-Csv <path\csvfile> -NoTypeInformation

Script to see Datastore Permission

Check HW VMware Compatibility Matrix

I need to check the Compatibility Matrix for the network IO device of ESXi HOST

Connect to ESXi with SSH and start this command

vmkchdev -l | grep vmnic

and the value are:

If you want check storage IO device change vmnic to vmhba

Determining Network/Storage firmware and driver version in ESXi (1027206) (vmware.com)

Check HW VMware Compatibility Matrix

ISCSI e Jumbo Frame

Abilitare o non abilitare i Jumbo Frame su una infrastruttura ISCSI?

Molte volte mi sono imbattuto in questo quesito, all’inzio ero molto scettico pensando a quanti attori  sono coinvolti ….e anche adesso lo sono, soprattutto quando devi mettere mano a una infrastruttura esistente e non hai switch dedicati al backend di comunicazione dei nostri hosts con lo storage.
Questo articolo di VMware riassume la mia opinione:
   
ISCSI e Jumbo Frame

Active/passive block storage array, Test Unit Ready (TUR) and ESXi 6.7

Nella  versione ESXi 6.7,  tra tutti i cambiamenti, è presente un modifica al parametro action_OnRetryErrors.

La modifica del parametro action_OnRetryErrors ha effetto su come viene gestita la Test Unit Ready (TUR), processo di controllo se un PATH verso una LUN di uno storage array è attivo o no. 

Fino alla versione 6.0/6.5 questo parametro era impostato a OFF, quindi nel caso di perdita di un PATH l’host ESXi continuava a eseguire un polling  sul path fino al ripristino. 

Nella nuova versione 6.7 questo paramentro è messo a ON  e quindi al primo errore il path viene messe “DEAD” e non vengono successivamente eseguite verifiche sullo stato del PATH,

In caso di storage SAS con connessione a HOST ESXi con due path (Attivo/passivo) la situazione creata nella versione 6.7 può risultare critica, perchè:

  •  In caso di test di ridondanza dell’infrastruttura Storage, con test di riavvio dei controller. Ci troveremo nella situazione dove i path, utilizzati dal controller che abbiamo riavviato, non tornano attivi. (Necessario un Reboot dell’HOST)
  • In caso di aggiornamento del firmware dello storage array,  procedura dove vengono riavviati uno alla volta i controller, ci troveremo nella situazione dove tutti i path sono marcati come DEAD e quindi i nostri HOST perdono la visibilità delle LUN utilizzate dai datastore.


Per risolvere il problema  si può procedere con le indicazioni di questa KB di VMware:

ESXi 6.7 hosts with active/passive or ALUA based storage devices may see premature APD events during storage controller fail-over scenarios (67006) 

Active/passive block storage array, Test Unit Ready (TUR) and ESXi 6.7

Show session speed real time TSM

I find with google search this query :

select char(client_name,10) as “Sess”,CAST(CAST(bytes_received/1024/1024 as decimal(15,0))/CAST((current_timestamp-start_time)seconds as decimal(15,0)) as decimal(10,2)) as “Receive [MB/s]”,CAST(CAST(bytes_sent/1024/1024 as decimal(15,0))/CAST((current_timestamp-start_time)seconds as decimal(15,0)) as decimal(10,2)) as “Sent [MB/s]” from sessions where session_type=’Node’

output:

Sess             Receive [MB/s]       Sent [MB/s]
———–     —————     ————-
KELLY                   4193.64              0.00
KELLY                      0.00              0.00

Show session speed real time TSM

How to mange controller raid with MegaCli over vmware esxi

xseries 2350 M4  + vmware esxi 5.1
Donwload megacli software from ibm site

How to install?

You need have active ssh connection to the esxi server 
Install to esxi server :

esxcli software vib install /tmp/vmware-esx-MegaCli-8.04.07.vib –no-sig-check

(The installation probably need put the host in manintenece mode and reboot server)

How to use?

Go to /opt/lsi/MegaCli/ and run ./MegaCli with option :

Check the status all of HD:

./MegaCli -PDList -aALL

or single HD

./MegaCli -PDInfo -PhysDrv [E:S] -aALL          (E is the enclosure and is the slot)

Download the log of controller:

./MegaCli -AdpEventLog -GetEvents -f events.log -aALL && cat event.log

Show info configuration:

./MegaCli -AdpAllInfo -aALL

Show controller configuration:

./MegaCli -CfgDsply -aALL

Battery status:

./MegaCli -AdpBbuCmd -aALL

Show rebuild status:

./MegaCli -PDRbld -ShowProg -PhysDrv [E:S] -aALL

And more info:

./MegaCli -h

 
How to mange controller raid with MegaCli over vmware esxi

Show configuration and status HP raid esxi 5.1

Use iso esxi 5.1  customized HP

~ # /opt/hp/hpacucli/bin/hpacucli
HP Array Configuration Utility CLI 9.40.12.0
Detecting Controllers…Done.
Type “help” for a list of supported commands.
Type “exit” to close the console.

=> ctrl all show config

Smart Array E200i in Slot 0 (Embedded)    (sn: QT7AMV7298     )

   array A (SAS, Unused Space: 0  MB)

      logicaldrive 1 (558.7 GB, RAID 5, OK)

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 300 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 300 GB, OK)
      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 300 GB, OK)

Show configuration and status HP raid esxi 5.1

SVC and Global Mirror Whit Change Volumes

In recent days I have configured and activated LBGM I read this redbook

and the implementation is easy. Now I have a replica every 12H

To check the last volume main change that has finished copying to the secondary site:
– Connect to SVC using CLI
– type :
IBM_2145:SVCMO:admin>lsrcconsistgrp PAUL

 and Freeze_time is the timestamp of the last completed copying
freeze_time 2012/12/18/05/02/22

SVC and Global Mirror Whit Change Volumes