Thursday, June 2, 2016

Find a disk serial number on a VMware vSphere ESXi HP Proliant host

I had an issue on a hard drive on my HP Proliant.

You must have installed your ESXi with the special HP distribution (available on VMware website)

STEP 1
  • On your vSphere client, log in your server (directly the ESXi host, not the vSphere appliance).
  • Click on your host, configuration, go to security profile
  • Select the SSH service, Options, Start.
    You can find other ways to enable SSH here, or using search engines.
  • Don't forget to disable SSH after your operation.
STEP 2

To find informations and SN about the disks, we will use hpssacli.
You can find further informations about this command here and here.

  • Log in your ESXi host using putty
    • Username : root
    • Password: your current root password
  •  cd /opt/hp/hpssacli/bin/
  • In order to show controler informations
    ./hpssacli ctrl all show detail
    Smart Array P420i in Slot 0 (Embedded)
       Bus Interface: PCI
       Slot: 0
       Serial Number: 001438027FEFE60
       Cache Serial Number: PBKUA0BRH5K3HN
       RAID 6 (ADG) Status: Enabled
       Controller Status: OK
       Hardware Revision: B
       Firmware Version: 4.68
       Rebuild Priority: Medium
       Expand Priority: Medium
       Surface Scan Delay: 15 secs
       Surface Scan Mode: Idle
       Queue Depth: Automatic
       Monitor and Performance Delay: 60  min
       Elevator Sort: Enabled
       Degraded Performance Optimization: Disabled
       Inconsistency Repair Policy: Disabled
       Wait for Cache Room: Disabled
       Surface Analysis Inconsistency Notification: Disabled
       Post Prompt Timeout: 0 secs
       Cache Board Present: True
       Cache Status: OK
       Cache Ratio: 25% Read / 75% Write
       Drive Write Cache: Disabled
       Total Cache Size: 512 MB
       Total Cache Memory Available: 304 MB
       No-Battery Write Cache: Disabled
       Cache Backup Power Source: Capacitors
       Battery/Capacitor Count: 1
       Battery/Capacitor Status: OK
       SATA NCQ Supported: True
       Spare Activation Mode: Activate on physical drive failure (default)
       Controller Temperature (C): 64
       Number of Ports: 2 Internal only
       Encryption Supported: False
       Driver Name: HP HPSA
       Driver Version: 5.5.0
       Driver Supports HP SSD Smart Path: False
  • To find defective disk (use the right slot, 2nd line on the last command)
    ./hpssacli ctrl slot=0 pd all show status
       physicaldrive 1I:1:1 (port 1I:box 1:bay 1, 600 GB): OK
       physicaldrive 1I:1:2 (port 1I:box 1:bay 2, 600 GB): Failed
       physicaldrive 1I:1:3 (port 1I:box 1:bay 3, 600 GB): OK
       physicaldrive 1I:1:4 (port 1I:box 1:bay 4, 600 GB): OK
       physicaldrive 2I:1:5 (port 2I:box 1:bay 5, 600 GB): OK
       physicaldrive 2I:1:6 (port 2I:box 1:bay 6, 600 GB): OK
  • To get more informations on all disk, including the serial number
    ./hpssacli ctrl slot=0 pd all show detail
    Smart Array P420i in Slot 0 (Embedded)

       array A

          physicaldrive 1I:1:1
             Port: 1I
             Box: 1
             Bay: 1
             Status: OK
             Drive Type: Data Drive
             Interface Type: SAS
             Size: 600 GB
             Native Block Size: 512
             Rotational Speed: 10500
             Firmware Revision: HPD3
             Serial Number: S0M1L5M9000XXXX
             Model: HP      EG0600FCVBK
             Current Temperature (C): 38
             Maximum Temperature (C): 49
             PHY Count: 2
             PHY Transfer Rate: 6.0Gbps, Unknown
             Drive Authentication Status: OK
             Carrier Application Version: 11
             Carrier Bootloader Version: 6

          physicaldrive 1I:1:2
             Port: 1I
             Box: 1
             Bay: 2
             Status: Failed
             Last Failure Reason: Mark bad failed
             Drive Type: Data Drive
             Interface Type: SAS
             Size: 600 GB
             Native Block Size: 512
             Rotational Speed: 10500
             Firmware Revision: HPD3
             Serial Number: S0M1L5M9000XXXX
             Model: HP      EG0600FCVBK
             Maximum Temperature (C): 53
             PHY Count: 2
             PHY Transfer Rate: 6.0Gbps, Unknown
             Drive Authentication Status: Not Applicable

          physicaldrive 1I:1:3
             Port: 1I
             Box: 1
             Bay: 3
             Status: OK
             Drive Type: Data Drive
             Interface Type: SAS
             Size: 600 GB
             Native Block Size: 512
             Rotational Speed: 10500
             Firmware Revision: HPD3
             Serial Number: S0M1L5M9000XXXX
             Model: HP      EG0600FCVBK
             Current Temperature (C): 42
             Maximum Temperature (C): 53
             PHY Count: 2
             PHY Transfer Rate: 6.0Gbps, Unknown
             Drive Authentication Status: OK
             Carrier Application Version: 11
             Carrier Bootloader Version: 6

          physicaldrive 1I:1:4
             Port: 1I
             Box: 1
             Bay: 4
             Status: OK
             Drive Type: Data Drive
             Interface Type: SAS
             Size: 600 GB
             Native Block Size: 512
             Rotational Speed: 10500
             Firmware Revision: HPD3
             Serial Number: S0M1L5M9000XXXX
             Model: HP      EG0600FCVBK
             Current Temperature (C): 43
             Maximum Temperature (C): 52
             PHY Count: 2
             PHY Transfer Rate: 6.0Gbps, Unknown
             Drive Authentication Status: OK
             Carrier Application Version: 11
             Carrier Bootloader Version: 6

          physicaldrive 2I:1:5
             Port: 2I
             Box: 1
             Bay: 5
             Status: OK
             Drive Type: Data Drive
             Interface Type: SAS
             Size: 600 GB
             Native Block Size: 512
             Rotational Speed: 10500
             Firmware Revision: HPD3
             Serial Number: S0M1L5M9000XXXX
             Model: HP      EG0600FCVBK
             Current Temperature (C): 43
             Maximum Temperature (C): 52
             PHY Count: 2
             PHY Transfer Rate: 6.0Gbps, Unknown
             Drive Authentication Status: OK
             Carrier Application Version: 11
             Carrier Bootloader Version: 6

          physicaldrive 2I:1:6
             Port: 2I
             Box: 1
             Bay: 6
             Status: OK
             Drive Type: Data Drive
             Interface Type: SAS
             Size: 600 GB
             Native Block Size: 512
             Rotational Speed: 10500
             Firmware Revision: HPD3
             Serial Number: S0M1L5M9000XXXX
             Model: HP      EG0600FCVBK
             Current Temperature (C): 39
             Maximum Temperature (C): 47
             PHY Count: 2
             PHY Transfer Rate: 6.0Gbps, Unknown
             Drive Authentication Status: OK
             Carrier Application Version: 11
             Carrier Bootloader Version: 6
    Once you've changed the disk, you can check the rebuild status using this command:
  • ./hpssacli ctrl slot=0 ld 1 show
    Smart Array P420i in Slot 0 (Embedded)

       array A

          Logical Drive: 1
             Size: 2.7 TB
             Fault Tolerance: 5
             Heads: 255
             Sectors Per Track: 32
             Cylinders: 65535
             Strip Size: 256 KB
             Full Stripe Size: 1280 KB
             Status: Recovering, 29% complete
             Caching:  Enabled
             Parity Initialization Status: Initialization Completed
             Unique Identifier: 600508B1001CF21E96713374CEBAD21D
             Logical Drive Label: A23BA9B5001438027FEFE6027CA
             Drive Type: Data
             LD Acceleration Method: Controller Cache


    Other commands in the documentations mentioned below.

    Comments welcome!

Tuesday, April 14, 2015

MSSQL 2008 on windows 2012 Server doesn't start, error 0x80070534 and Event ID : 17058

First symptom : the service doesn't start.
I quick look in the event log :
Event ID : 17058
initerrlog: Could not open error log file ''. Operating system error = 3(The system cannot find the path specified.).

I checked the security of my folders (where the instance is installed), no problem.

What is important at this point, is that I just promoted my server as a domain controller. Beginning of my problem.

Second symptom : changing the service account fails with error 0x80070534
I went in my SQL Configuration editor in order to change the service account information.
0x80070534 No mapping between account names and security IDs was done.
Impossible to change credentials.
I also tried ti change the account directly in the windows Service MMC, no way to start the service as local account or even Administrator.

The following article gave the final clue : http://serverfault.com/questions/24484/sql-server-2005-on-2008-dc-cannot-change-service-user

After a few googling, it cames that my problem is a windows SID problem. After promoting my server, some SID changed, and my server was unable start using the old credentials.

To solve this problem, go to
Regedit
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLxxx.Instance\Setup
locate SQLGroup String. It contains the SID which has changed.
locate AGTGroup String. It contains the correct SID.

Just copy the content of the AGTGroup string in the SQLGroup string.
AGTGroup = S-1-5-21-3474037693-4059913137-208468936-1004
SQLGroup = S-1-5-21-3474037693-4059913137-208468936-1003

In order to be sure of the SID of the group, you can launch getsid.
This article may help you find the correct group SID : http://blogs.msdn.com/b/jorgepc/archive/2009/11/19/the-domain-group-cannot-be-validated-for-the-service-sql-server-sql-server-2005-cluster-setup-error.aspx
You can use this tool to get SQLGroup SID : https://technet.microsoft.com/en-us/sysinternals/bb897417.aspx


Hope this article will help you

Tuesday, October 8, 2013

Create a simple Drupal 7 module - Hello World page

A Drupal module is made at least by 2 elements :
  • a .info file
  • an other file (.php, .inc ?)

To choose a name for you module, don't forget those basic rules :
  • no capital letter
  • no special character (excepted _ underscore)

Your first .info file

A .info is in fact a your_module_name.info file.
Let's make in your example a drupal_test module.

name (mandatory)

The name of your module (with capital letters and spaces this time, if you want)
name = Drupal Test Module

description (recommended)

description = A super duper test module !

core (mandatory)

core = 7.x

files[]

The location of your (php ?) files
files[] = inc/example.php

The whole .info file 

name = Drupal Test Module
description = Provides a really neat widget for your site's sidebar.
core = 7.x
files[] =
inc/example.php
For Drupal 7, you can find all informations about .info files here:
https://drupal.org/node/542202

 Now the example.php file

 You can now edit your php file, located in /sites/all/modules/drupal_test/inc/example.php

We will make a simple "Hello World" test. We will
  • make a menu link (make shortcut like http://www.mywebsite.com/drupal_test/mylink)
  • create a basic content (your "Hello World")
in your example.php module, create a drupal_test_menu() function.
function drupal_test_menu() {
    $items['drupal_test/mylink'] = array(
      'page callback' => 'drupal_test_hello_world',
    );
    return $items;
  }
This part redirects http://www.mywebsite.com/drupal_test/mylink to your website, and calls the
drupal_test_hello_world()function.
function drupal_test_hello_world() {
    return array(
      '#markup' => '<p>Hello world</p>', 
    );
  }
 That's it !

If you have questions, i'll try to answer you. Do not hesitate to leave comments.

Monday, June 10, 2013

Drupal 7 - How to set permissions on your module using hook_permission() and user_access()

You're developing a module and you need site administrator to handle with permissions.

There are two steps :

  • Make your permission string (such as "administer nodes" in the admin/people/permissions page)
  • Check if user has access to the defined string
Let's see how to do it.
  • We will use hook_permission() to add your own "string" in the permission management page.
function mymodulename_permission() {
  return array(
    'my own permission string' => array(
      'title' => t('Administer my module'),
      'description' => t('Perform administration tasks for my module.'),
    ),
  );
}
Now you can administer permissions for your module. Note that you can add many permissions strings in the array you return.
You can now find your permission string at this page : admin/people/permissions
  •  When you're coding your page, you can user user_access() to check if the connected user has the given right.

    $string = "my own permission string";
    user_access($string)
    the result is a boolean value. True if the user has access, False if not.
    You can use user_access in the hook_menu() function. Here is an example :
    function mymodulename_menu() {
        $items = array();

        $items['mymodule-page-address'] = array(//this creates a URL that will call this form at "examples/form-example"
            'title' => 'Menu link name', //page title
            'description' => 'A form to mess around with.',
            'page callback' => 'drupal_get_form', //this is the function that will be called when the page is accessed.  for a form, use drupal_get_form
            'page arguments' => array('my_callback_function'), //put the name of the form here
            'access callback' => 'user_access',
            'access arguments' => array('my own permission string
    '),
        );

        return $items;
    }

Monday, August 1, 2011

Echange Certificate expires

On SBS 2008, one year after the initial installation, your Exchange 2007 certificate will be expired.

Under Exchange Shell
Get-ExchangeCertificate | List
Locate the expired certificate and copy the footprint
Create a new certificate

New-ExchangeCertificate
Copy the new certificate thumbprint in order to activate it.
Enable-ExchangeCertificate -Thumbprint F7A8F1B443A0E7266C72CDE0603302C07B856076 -Service IIS
Then you can remove the old certificate.

Remove-ExchangeCertificate -Thumbprint 157700393E5D76615E855A773CFA08AB5842DFB0


After, you will need to install the new certificate to your computers. You can use GPO to do it.

Wednesday, March 16, 2011

How to fix Exchange 452 4.3.1 Insufficient system resources

The first symptom : no incoming mails in your Exchange Organisation.
The first test to make : try to test your incoming SMTP service using telnet.
If you have the following result, you're reading the right post !
452 4.3.1 Insufficient system resources
If you have a quick look in your event log, you will find a 15002 event message, explaining you that your disk space is low. Here we are.
Different security levels are set in exchange, chained to different reactions : http://technet.microsoft.com/en-us/library/bb397220(EXCHG.80).aspx

Two ways to get out of this issue :
  1. increase disk space
  2. disable the Back Pressure Feature
For the first point, no lesson, just act as you are used to.
For the second point : Back Pressure Feature.
Differents triggers :
  • Disk space, memory, ...
Three levels :
  • Normal Action: The Exchange Server 2007 Server accepts new connections and messages.
  • Medium Action: The resources sre starting to be overused. Back pressure is applied to the server in a limited manner. Messages from senders in the authoritative domain can flow, but the server will reject new connections and messages from other sources.
  • High Action: A resource is being overused. All message flow will stop and the server will reject all new connections and messages.
To disable the Back Pressure Feature, you have to edit the file located in the bin folder of your exchange server : EdgeTransport.exe.config
Locate the EnableResourceMonitoring param and put the value to "false".
Restart the Exchange Transport Service using the exchange shell :
Restart-Service msExchangeTransport
Sources :

How to test SMTP server using telnet : here is the script

telnet mail.mydomain.com 25
EHLO mydomain.com
MAIL FROM:chris@microsoft.com
RCPT TO:kate@mydomain.com NOTIFY=success,failure
DATA
Subject: Test depuis Contoso

This is a test message
.
QUIT
Source : http://technet.microsoft.com/fr-fr/library/bb123686.aspx
Simple version : http://exchange.mvps.org/smtp_frames.htm