Thursday, September 29, 2016

PowerCli script to RR IOPS 3PAR + set naa. LUNs to RR

#Connect-VIServer -Server P111vc01.st.com

$esxcli = Get-EsxCli

Get-VMHost btpesxu4c1b6.st.com| Get-ScsiLun -CanonicalName "naa.500*" | Set-ScsiLun -MultipathPolicy "roundrobin"

Get-VMHost btpesxu4c1b6.st.com| Get-ScsiLun -CanonicalName "naa.60002ac0000000000000003400006056*" | Set-ScsiLun -MultipathPolicy "roundrobin"

#esxcli storage nmp satp rule add -s "VMW_SATP_ALUA" -P "VMW_PSP_RR" -O iops=100 -c "tpgs_on" -V "3PARdata" -M "VV" -e "HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule"

$esxcli.storage.nmp.device.list() | where {$_.device -like "naa.500*"} | %{

  $configBefore = $esxcli.storage.nmp.psp.roundrobin.deviceconfig.get($_.device)

  $esxcli.storage.nmp.psp.roundrobin.deviceconfig.set(0, 1, $_.device, [long]100, "iops", $false)

  $configAfter = $esxcli.storage.nmp.psp.roundrobin.deviceconfig.get($_.device)

  # Uncomment the following lines if you want to report the settings

   $configBefore

   $configAfter

}

Wednesday, September 28, 2016

Stubborn vCenter 5.5 won't start Fix



To work around this issue, restart the VMware Secure Token Service:

  1. Log in as an Administrator to the server that is running vCenter Server.
  2. Click Start > Run, enter services.msc, and click OK. The Services window opens.
  3. Stop these services:

    VMware Secure Token Service
    VMware Identity Management Service
    VMware Certificate Service
    VMware KDC Service
    VMware Directory Service

  4. Start these services:

    VMware Directory Service
    VMware KDC Service
    VMware Certificate ServiceVMware Identity Management Service
    VMware Secure Token Service
    VMware VirtualCenter Server
For more information on the vCenter Server services, see Stopping, starting, or restarting vCenter services (1003895).
For the vCenter Server Appliance:

  1. Connect to the vCenter Server Appliance via SSH. For more information, see Enable or Disable SSH Administrator Login on the VMware vCenter Server Appliance section in the VMware vSphere 5.5 vCenter Server and Host Management Guide.
  2. Log in as root
  3. Run this command to restart the VMware Secure Token Service:

    /etc/init.d/vmware-stsd restart
    /etc/init.d/vmware-sts-idmd restart
  4. Run this command to restart the vCenter Server services:

    service vmware-vpxd restart

Wednesday, September 21, 2016

Pure Host Profile RR

http://www.codyhosterman.com/2015/05/setting-flasharray-best-practices-with-esxi-host-profiles/

WIndows No Boot record fix

After performing a Symantec System Recovery (SSR) 2010/2011/2012 restore of a Windows vista/7/2008 system, the system fails to boot and a BIOS level text error message is displayed.

Error Message

The error differ with each hardware system:
  • Operating System Not Found
  • Missing Operating System
  • Non-System Disk or Disk Error
  • BOOTMGR is missing

Cause

The Master Boot Record (MBR) and/or Boot Configuration Data (BCD) information is missing or corrupt on the restored disk.

Solution

The MBR and BCD will need to be manually rebuilt.
To rebuild the MBR and BCD do one of the following methods:
METHOD 1: Rebuilding the MBR only (Windows XP/2003/VISTA/7/2008)
1. Boot the recovered system using the Symantec System Recovery disk (SRD) once again.
2. Click Analyze, then click Explore My Computer and identify the drive letter use by the SRD then close this window.
3. Click Analyze, then click Open Command Shell Window. Navigate to the drive letter for CD-ROM drive as discovered from step 2 by typing the drive letter and a colon and pressing Enter (example: D: ).
4. Type CD MANAGER to get into the manager directory (example: D:\MANAGER).
5. Do one of the following:
        If system is Windows Vista or later, type BOOTSECT /NT60 c: /MBR (ensure that c:\ is the system volume. If not, adjust drive letter accordingly).
        If system is Windows XP/2003, type BOOTSECT /NT52 c: /MBR (ensure that c:\ is the system volume. If not, adjust drive letter accordingly).
6. Remove the recovery disk, reboot the system.
METHOD 2: Rebuilding the MBR & BCD (Windows VISTA/7/2008)
1. Insert the Windows Vista/7/2008 installation CD/DVD into the recovered system's DVD-ROM and restart the system.
2. Select to boot from the Windows installation CD/DVD when prompted.
3. From the menu options displayed, choose the repair option and then open a command prompt option.
4. At the command prompt, type the following commands pressing the Enter key after each line:

c:
cd boot
bootsect /nt60 c: /force /mbr
bootrec /rebuildbcd

NOTE: After using the "bootrec /rebuldbcd" command, you will be prompted to accept a Windows installation. Accept the installation, then wait for the process to finish. Once it's done, reboot your computer and you should have a boot loader ready to go.
METHOD 3: If the "boot" folder is not on the system C: drive (Windows VISTA/7/2008)
Do the following to copy the "boot" folder form the Windows installation CD to the C: drive.
1. Insert the Windows Vista/7/2008 installation CD/DVD into the recovered system's DVD-ROM and restart the system.
2. Select to boot from the Windows installation CD/DVD when prompted.
3. From the menu options displayed, choose the repair option and then open a command prompt option.
4. At the command prompt, type the following commands pressing the Enter key after each line:
NOTE: Commands below which assumes E: is the DVD-ROM that the Windows installation is in; change the drive letter to fit the assigned letter for this CD/DVD-ROM if it differs.

mkdir c:\boot
copy e:\boot\* c:\boot\
c:
cd boot
bootsect /nt60 c: /force /mbr
bootrec /rebuildbcd
 
METHOD 4: If rebuilding the mbr and bcd still dose not work (Windows VISTA/7/2008)
A startup repair is likely needs to be done. Follow the steps below to perform a startup repair.
1. Insert the Windows Vista/7/2008 installation CD/DVD into the recovered system's DVD-ROM and restart the system.
2. Select to boot from the Windows installation CD/DVD when prompted.
3. From the menu options displayed, choose the repair option and then open a command prompt option.
4. At the command prompt, type the following commands pressing the Enter key after each line:
cd recovery
run startrep.exe

Create SATP Rules + Host Profiles + 3PAR PURE

# esxcli storage nmp satp rule add -s "VMW_SATP_ALUA" -P "VMW_PSP_RR" -O iops=1 -c "tpgs_on" -V "3PARdata" -M "VV" -e "HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule"
For host persona 6 the following command would be run.
# esxcli storage nmp satp rule add -s "VMW_SATP_DEFAULT_AA" -P "VMW_PSP_RR" -O iops=1 -c "tpgs_off" -V "3PARdata" -M "VV" -e "HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule"
The difference between the rules is that host persona 11 is ALUA, where as host persona 6 is Active/Active. This post explains ALUA in further detail.
Logging into each ESXi host to create the rule does not seem like a good use of time, so I went looking for some better ways of creating these rules with out having to do it manually. There are multiple ways of adding these rules including Host ProfilesPowerClivCLI
I went searching around for a solution for PowerCli and found this article, it talks about the best practices on the 3PAR and adds some PowerCli scripts to configure these for the 3PAR. Unfortunately the article gives a PowerCli Script that changes the properties on each LUN instead of adding the SATP rule to the ESXi host. While this will work for the existing LUNs, we want it to be the default on all new LUNs as well, so we want a global change rather than a LUN specific change. So I did a little digging into the PowerCli Get-Esxcli command and found thesyntax for the commandThis article gives some example PowerCli scripts using Get-Esxcli. Unfortunately I did not find an example with the syntax for the command that I wanted, so I went to the command line and queried the Get-Esxcli command for the esxcli storage nmp satp rule add command. We can see the options below.
boolean add(boolean boot, string claimoption, string description, string device, string driver, boolean force, string model, string option, string psp, string pspoption, string satp, string transport, string type, string vendor)
So we need to fill in the appropriate values for our SATP rule and send in $null for the options we want to omit. I came up with the following command to add the rule as per the best practices.
PowerCLI C:\> $esxcli.storage.nmp.satp.rule.add($null,"tpgs_on","HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule",$null,$null,$null,"VV",$null,"VMW_PSP_RR","iops=1","VMW_SATP_ALUA",$null,$null,"3PARdata")
true
As you can see in the example above, it returned true when I ran the command. I do not really trust this, so I need to confirm that the rule actually exists. Let’s verify that the rule was put in place. The command below will look for any SATP rules that have 3PAR in the description.
PowerCLI C:\> $esxcli.storage.nmp.satp.rule.list() | where {$_.description -like "*3par*"}


ClaimOptions : tpgs_on
DefaultPSP   : VMW_PSP_RR
Description  : HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule
Device       :
Driver       :
Model        : VV
Name         : VMW_SATP_ALUA
Options      :
PSPOptions   : iops=1
RuleGroup    : user
Transport    :
Vendor       : 3PARdata

Example: MDS Zoning

on BTP-MDS03 SWITCH (HBA1), zone the following for BTP Prod Pure Array #2








zone name btpesxu4c3b4-BTP-PURE02-VDI-CT0FC1 vsan 1
  member device-alias BTP-VDI-CT0FC1
  member device-alias btpesxu4c3b4

zone name btpesxu4c3b4-BTP-PURE02-VDI-CT0FC3 vsan 1
  member device-alias BTP-BTP-VDI-CT0FC3
  member device-alias btpesxu4c3b4

zone name btpesxu4c3b4-BTP-PURE02-VDI-CT1FC1 vsan 1
  member device-alias BTP-PURE02-VDI-CT1FC1
  member device-alias btpesxu4c3b4

zone name btpesxu4c3b4-BTP-PURE02-VDI-CT1FC3 vsan 1
  member device-alias BTP-PURE02-VDI-CT1FC3
  member device-alias btpesxu4c3b4

zoneset name Production_Zoneset_A vsan 1
  member btpesxu4c3b4-BTP-PURE02-VDI-CT0FC1
  member btpesxu4c3b4-BTP-PURE02-VDI-CT0FC3
  member btpesxu4c3b4-BTP-PURE02-VDI-CT1FC1
  member btpesxu4c3b4-BTP-PURE02-VDI-CT1FC3

zoneset activate Production_Zoneset_A vsan 1



on BTP-MDS04 SWITCH (HBA2), zone the following for BTP Prod Pure Array #2


config t

zone name btpesxu4c3b4-BTP-PURE02-VDI-CT0FC0 vsan 1
  member device-alias BTP-PURE02-VDI-CT0FC0
  member device-alias btpesxu4c3b4

zone name btpesxu4c3b4-BTP-PURE02-VDI-CT0FC2 vsan 1
  member device-aliasBTP-PURE02-VDI-CT0FC2
  member device-alias btpesxu4c3b4

zone name btpesxu4c3b4-BTP-PURE02-VDI-CT1FC0 vsan 1
  member device-alias BTP-PURE02-VDI-CT1FC0
  member device-alias btpesxu4c3b4

zone name btpesxu4c3b4-BTP-PURE02-VDI-CT1FC2 vsan 1
  member device-alias BTP-PURE02-VDI-CT1FC2
  member device-alias btpesxu4c3b4

zoneset name Production_Zoneset_B vsan 1
  member btpesxu4c3b4-BTP-PURE02-VDI-CT0FC0
  member btpesxu4c3b4-BTP-PURE02-VDI-CT0FC2
  member btpesxu4c3b4-BTP-PURE02-VDI-CT1FC0
  member btpesxu4c3b4-BTP-PURE02-VDI-CT1FC2

zoneset activate Production_Zoneset_B vsan 1

Wednesday, September 14, 2016

Create Network-admin account on Cisco switch / DCNM /username



You must add the account dcnmadmin for DCNM to discover and see the devices  The credentials are:
Username: dcnmadmin
Password: *****

Follow the instructions below:
ATL-FC2(config)# username dcnmadmin password A*******d role network-admin
ATL-FC2(config)# show user-account
switch# copy running-config startup-config


Tuesday, September 13, 2016

SQL Diskpart + Windows 2003

The approved method for using diskpart so the disk is aligned correctly for Windows 2003 SQL servers @ 64K allocation table (best performance)

2008+ can use MMC disk manager

Invoke Diskpart
C:\>diskpart
Microsoft DiskPart version 5.2.3790.3959
Copyright (C) 1999-2001 Microsoft Corporation.
On computer: MYTESTBOX
You must select the disk to act on
DISKPART> select disk 5
Disk 5 is now the selected disk.
Create a partition using the EMC-recommended alignment offset
DISKPART> create partition primary align=64
DiskPart succeeded in creating the specified partition.
Select the partition / volume that you just created
DISKPART> select volume=0
Volume 0 is the selected volume.
Assign a drive letter
DISKPART> assign letter=o
DiskPart successfully assigned the drive letter or mount point.
Exit Diskpart
DISKPART> exit
Leaving DiskPart…
C:\>
You can now use the disk management MMC to format the partition

Vmware NSX SSL creation 

Using OpenSSL for NSX Manager SSL import: Creates CSR and 4096 bit KEY Creating NSX 6.4.2 SSL    openssl req -out nsxcert.csr -newkey rsa:40...