Thursday, August 25, 2016

View Cisco UCS Management

FI01-A(nxos)# show interface mgmt 0
mgmt0 is down (Link not connected)
  Hardware: GigabitEthernet, address: 547f.eead.ce40 (bia 547f.eead.ce40)
  Internet Address is 172.24.0.12/24
  MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA
  auto-duplex, 100 Mb/s
  EtherType is 0x0000
  1 minute input rate 304 bits/sec, 0 packets/sec
  1 minute output rate 0 bits/sec, 0 packets/sec
  Rx
    53574 input packets 0 unicast packets 53574 multicast packets
    0 broadcast packets 4012306 bytes
  Tx
    0 output packets 0 unicast packets 0 multicast packets
    0 broadcast packets 0 bytes
FI01-B(nxos)# show interface mgmt 0
mgmt0 is down (Link not connected)
  Hardware: GigabitEthernet, address: 547f.eead.c780 (bia 547f.eead.c780)
  Internet Address is 172.24.0.13/24
  MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
     reliability 6839/255, txload 1/255, rxload 1/255
  Encapsulation ARPA
  auto-duplex, 10 Mb/s
  EtherType is 0x0000
  1 minute input rate 0 bits/sec, 0 packets/sec
  1 minute output rate 0 bits/sec, 0 packets/sec
  Rx
    0 input packets 0 unicast packets 0 multicast packets
    0 broadcast packets 0 bytes
  Tx
    0 output packets 0 unicast packets 0 multicast packets

Wednesday, August 24, 2016

Erase UCS to Factory Defaults

Here is the commands needed to erase the config on the UCS:

UCS# connect local-mgmt
UCS(local-mgmt)# erase configuration

All UCS configurations will be erased and system will reboot. Are you sure? (yes/no): yes

from each FI

show cluster extended-state

Tuesday, August 23, 2016

How To Change the IP Address of Fabric Interconnects


How To Change the IP Address of Fabric Interconnects

To change IP for fabric interconnects, login to either one via console:
  1. UCS-A# scope fabric-interconnect a
  2. UCS-A /fabric-interconnect # set out-of-band ip <management IP for FI> netmask <subnet mask> gw <default gateway>
  3. Repeat for the second fabric interconnect.
To change the virtual IP used for system management, this should be in the same VLAN as the individual fabric interconnect IPs:
  1. UCS-A# scope system
  2. UCS-A /system # set virtual-ip <management IP>
Finally check to see that there are no errors, then actually commit if everything checks out:
  1. UCS-A# commit-buffer verify-only
  2. UCS-A# commit-buffer

Friday, August 19, 2016

Wednesday, August 17, 2016

Enable Root Login for Red Hat & Change NIC IP

Change IP in Red Hat

Nano /etc/sysconfig/network-scripts/ifcfg-eth0

(nano ifcfg-eth0)
Ctrl-O
Enter to write to file and save
Ctrl-X to exit


/etc/init.d/network restart



Enable Root SSH

console -> sudo nano /etc/ssh/sshd_config

PermitRootLogin yes

save

sudo service sshd restart

Enable Root Login for Red Hat & Change NIC IP

Change IP in Red Hat

Nano /etc/sysconfig/network-scripts/ifcfg-eth0

(nano ifcfg-eth0)
Ctrl-O
Enter to write to file and save
Ctrl-X to exit


/etc/init.d/network restart



Enable Root SSH

console -> sudo nano /etc/ssh/sshd_config

PermitRootLogin yes

save
5:14 PM
sudo service sshd restart

Vcenter appliance network wizard

1. Press F2 to login
2. Enter default username: root
3. Enter default password: vmware
4. Run command: /opt/vmware/share/vami/vami_config_net
5. Press 6 to setup eth0
6. After allocate a static IP Address to the VCSA the post configuration can be done by using the following URL: 
https://static-ip-address:5480

Monday, August 15, 2016

Set Perennially Reservation with PowerCLI

$reports = @()
$vms = Get-VM | Get-View
foreach($vm in $vms){
     foreach($dev in $vm.Config.Hardware.Device){
          if(($dev.gettype()).Name -eq "VirtualDisk"){
               if(($dev.Backing.CompatibilityMode -eq "physicalMode") -or
               ($dev.Backing.CompatibilityMode -eq "virtualMode")){
                    $row = "" | select VMName, VMHost, HDDeviceName, HDFileName, HDMode, HDsize, HDDisplayName
                    $row.VMName = $vm.Name
                    $esx = Get-View $vm.Runtime.Host
                    $row.VMHost = ($esx).Name
                    $row.HDDeviceName = $dev.Backing.DeviceName
                    $row.HDFileName = $dev.Backing.FileName
                    $row.HDMode = $dev.Backing.CompatibilityMode
                    $row.HDSize = $dev.CapacityInKB
                    $row.HDDisplayName = ($esx.Config.StorageDevice.ScsiLun | where {$_.Uuid -eq $dev.Backing.LunUuid}).DisplayName
                    $reports += $row
               }
          }
     }
 }

$report|export-csv .\rawmaps.csv -notypeinformation
$rawvms=import-csv .\rawmaps.csv
foreach($rawvm in $rawvms)
{
$vm=get-vm $rawvm.VMName

#Collecting the various pieces of information
$cluster=$vm|Get-cluster

$vmhosts=$cluster|get-vmhost

#Here I look for Physical RDMs, but you can change it to RawVirtual if you like
$scsinames=$vm|get-harddisk -DiskType RawPhysical

$scsihost=$vm|get-vmhost

$clihost=get-esxcli -vmhost $scsihost

#Checks the scsinames against the host to see if they are perennially reserved or not
#If Not places them in the variable $devices
$devices= $scsinames|select -expand scsicanonicalname|% {$clihost.storage.core.device.list("$_")}|? {$_.isperenniallyreserved -like "false"}|select -expand device

#ForEach of the hosts, set the device to be perennially reserved.
ForEach ($vmhost in $vmhosts)

{

$clihost=get-esxcli -vmhost $vmhost
$vmhost.name
ForEach ($device in $devices)
{
$device
$clihost.storage.core.device.setconfig($false, "$device", $true)
}
}

}



******************************************************************












I am going to make this one short and sweet.
On a reboot, hosts that have access to RDM LUNs can take a LONG time to reboot. In order to correct to correct this we can set the hosts to have the LUNs perennially reserved.
The only way to set this is by typing(sorry no GUI fix).
In esxcli we see,
esxcli storage core device setconfig -d naa.12345671234982734987 –perennially-reserved=true
(Above I just started typing random numbers, but you get the idea)
In general though you are going to have more than one host in a cluster that have access to the same RDMs. As usual PowerCLI to the rescue.
This script will pull the RDMs from a specific VM and set the Perennially Reserved flag for all the hosts in the cluster.http://www.vnoob.com/2015/12/set-perennially-reservation-with-powercli/


$vm=get-vm "VM to Set perrenial reservation for"
#Collecting the various pieces of information
$cluster=$vm|Get-cluster
$vmhosts=$cluster|get-vmhost
#Here I look for Physical RDMs, but you can change it to RawVirtual if you like
$scsinames=$vm|get-harddisk -DiskType RawPhysical
$scsihost=$vm|get-vmhost
$clihost=get-esxcli -vmhost $scsihost
#Checks the scsinames against the host to see if they are perennially reserved or not
#If Not places them in the variable $devices
$devices= $scsinames|select -expand scsicanonicalname|% {$clihost.storage.core.device.list("$_")}|? {$_.isperenniallyreserved -like "false"}|select -expand device
#ForEach of the hosts, set the device to be perennially reserved.
ForEach ($vmhost in $vmhosts)
{
$clihost=get-esxcli -vmhost $vmhost
$vmhost.name
ForEach ($device in $devices)
{
$device
$clihost.storage.core.device.setconfig($false, "$device", $true)
}
}

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...