Sharing

2012年4月29日 星期日

Get Hard Disk Information on Linux

General Hard Disk Information

  • lshw
root@ubuntu:~$ lshw | less | grep *-
*-core
     *-firmware
     *-cpu:0
        *-cache:0
        *-cache:1
        *-cache:2
     *-memory:0
        *-bank:0
        *-bank:1
        *-bank:2
        *-bank:3
        *-bank:4
        *-bank:5
     *-pci:0
        *-pci:0
           *-network:0
           *-network:1 DISABLED
        *-pci:1
           *-network:0 DISABLED
           *-network:1 DISABLED
        *-pci:2
        *-pci:3
           *-storage
              *-enclosure UNCLAIMED
              *-disk:0
              *-disk:1
              *-disk:2
              *-disk:3
              *-disk:4
              *-disk:5
              *-disk:6
              *-disk:7


root@ubuntu:~$ lshw -class disk
  *-disk
       description: ATA Disk
       product: ST9250610NS
       vendor: Seagate
       physical id: 0.0.0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: SN01
       serial: 9XE00BTT
       size: 232GiB (250GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=0003cad9


root@ubuntu:~$ lshw -short -C disk
H/W path               Device     Class      Description
========================================================
/0/100/5/0/2.0.0       /dev/sdb   disk       999GB MR9260-4i
/0/100/5/0/2.1.0       /dev/sdc   disk       1999GB MR9260-4i
/0/100/5/0/2.2.0       /dev/sdd   disk       999GB MR9260-4i
/0/100/5/0/2.3.0       /dev/sde   disk       1999GB MR9260-4i
/0/100/5/0/2.4.0       /dev/sdf   disk       299GB MR9260-4i
/0/100/5/0/2.5.0       /dev/sdg   disk       239GB MR9260-4i
/0/100/5/0/2.6.0       /dev/sdh   disk       299GB MR9260-4i
/0/100/5/0/2.7.0       /dev/sdi   disk       119GB MR9260-4i
/0/100/1f.2/0.0.0      /dev/sda   disk       250GB ST9250610NS

  • hdparm
root@ubuntu:~$ hdparm -I /dev/sda
/dev/sda:

ATA device, with non-removable media
        Model Number:       ST9250610NS
        Serial Number:      9XE00BTT
        Firmware Revision:  SN01
        Transport:          Serial, SATA Rev 3.0
Standards:
        Used: unknown (minor revision code 0x0029)
        Supported: 8 7 6 5
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors:  488397168
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:      238475 MBytes
        device size with M = 1000*1000:      250059 MBytes (250 GB)
        cache/buffer size  = unknown
        Nominal Media Rotation Rate: 7200
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = ?
        Recommended acoustic management value: 254, current value: 0
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    DOWNLOAD_MICROCODE
                SET_MAX security extension
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    WRITE_{DMA|MULTIPLE}_FUA_EXT
           *    64-bit World wide name
                Write-Read-Verify feature set
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
           *    unknown 119[7]
           *    Gen1 signaling speed (1.5Gb/s)
           *    Gen2 signaling speed (3.0Gb/s)
           *    Gen3 signaling speed (6.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Phy event counters
           *    unknown 76[15]
                Device-initiated interface power management
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT LBA Segment Access (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
                unknown 206[7]
                unknown 206[12] (vendor specific)
Security:
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
                supported: enhanced erase
        48min for SECURITY ERASE UNIT. 48min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000c50035319eee
        NAA             : 5
        IEEE OUI        : 000c50
        Unique ID       : 035319eee
Checksum: correct

  • dmesg
root@ubuntu:~$ dmesg | grep scsi
[    3.735457] scsi0 : ahci
[    3.735609] scsi1 : ahci
[    3.735747] scsi2 : ahci
[    3.735885] scsi3 : ahci
[    3.736024] scsi4 : ahci
[    3.736164] scsi5 : ahci
[    4.178643] scsi 0:0:0:0: Direct-Access     ATA      ST9250610NS      SN01 PQ: 0 ANSI: 5
[    4.178960] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    5.950530] scsi6 : LSI SAS based MegaRAID driver
[    5.953670] scsi 6:0:4:0: Direct-Access     ATA      INTEL SSDSA2BW30 0362 PQ: 0 ANSI: 5
[    5.965343] scsi 6:0:5:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    5.977082] scsi 6:0:6:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    5.988839] scsi 6:0:7:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    6.000583] scsi 6:0:8:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    6.012259] scsi 6:0:9:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    6.013360] scsi 6:0:10:0: Direct-Access     ATA      INTEL SSDSA2BZ30 0362 PQ: 0 ANSI: 5
[    6.034102] scsi 6:0:11:0: Direct-Access     ATA      INTEL SSDSC2BW24 400i PQ: 0 ANSI: 5
[    6.034771] scsi 6:0:12:0: Enclosure         Wistron  LSI2x20          0900 PQ: 0 ANSI: 5
[    6.046667] scsi 6:0:13:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    6.058300] scsi 6:0:14:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    6.070055] scsi 6:0:15:0: Direct-Access     ATA      SAMSUNG HE103SJ  0001 PQ: 0 ANSI: 5
[    6.091376] scsi 6:0:16:0: Direct-Access     ATA      D2CSTK251M11-012 2.15 PQ: 0 ANSI: 5
[    6.107324] scsi 6:2:0:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.107554] scsi 6:2:1:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.107775] scsi 6:2:2:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.107981] scsi 6:2:3:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.108194] scsi 6:2:4:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.108406] scsi 6:2:5:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.108635] scsi 6:2:6:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.108864] scsi 6:2:7:0: Direct-Access     LSI      MR9260-4i        2.70 PQ: 0 ANSI: 5
[    6.124449] scsi 6:0:12:0: Attached scsi generic sg1 type 13
[    6.124992] sd 6:2:0:0: Attached scsi generic sg2 type 0
[    6.125425] sd 6:2:1:0: Attached scsi generic sg3 type 0
[    6.125765] sd 6:2:2:0: Attached scsi generic sg4 type 0
[    6.126186] sd 6:2:3:0: Attached scsi generic sg5 type 0
[    6.126550] sd 6:2:4:0: Attached scsi generic sg6 type 0
[    6.126999] sd 6:2:5:0: Attached scsi generic sg7 type 0
[    6.127455] sd 6:2:6:0: Attached scsi generic sg8 type 0
[    6.127962] sd 6:2:7:0: Attached scsi generic sg9 type 0


  • smartctl
root@ubuntu:~$ smartctl -d ata -a -i /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-23-generic] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     ST9250610NS
Serial Number:    9XE00BTT
LU WWN Device Id: 5 000c50 035319eee
Firmware Version: SN01
User Capacity:    250,059,350,016 bytes [250 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Mon Apr 30 11:38:24 2012 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                (  634) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   1) minutes.
Extended self-test routine
recommended polling time:        (  49) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x10bd) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   081   066   044    Pre-fail  Always       -       120497634
  3 Spin_Up_Time            0x0003   097   096   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       134
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   060   059   030    Pre-fail  Always       -       12888092699
  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       1924
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       133
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   095   000    Old_age   Always       -       73015558161
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   071   041   045    Old_age   Always   In_the_past 29 (0 117 29 23)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       117
193 Load_Cycle_Count        0x0032   099   099   000    Old_age   Always       -       2509
194 Temperature_Celsius     0x0022   029   059   000    Old_age   Always       -       29 (0 19 0 0)
195 Hardware_ECC_Recovered  0x001a   117   100   000    Old_age   Always       -       120497634
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

  • sdparm
root@ubuntu:~$ sdparm /dev/sda
/dev/sda: ATA       ST9250610NS       SN01
Read write error recovery mode page:
  AWRE        1
  ARRE        0
  PER         0
Caching (SBC) mode page:
  WCE         1
  RCD         0
Control mode page:
  SWP         0

  • sfdisk
root@ubuntu:~$ sfdisk -s
/dev/sda: 244198584
/dev/sdc: 1952448512
/dev/sdd: 976224256
/dev/sde: 1952448512
/dev/sdb: 976224256
/dev/sdg: 233897984
/dev/sdf: 292487168
/dev/sdh: 292487168
/dev/sdi: 116686848
total: 7037103288 blocks


  • hwinfo
root@ubuntu:~$ hwinfo --disk
> hal.1: read hal dataprocess 2975: arguments to dbus_move_error() were incorrect, assertion "(dest) == NULL || !dbus_error_is_set ((dest))" failed in file ../../dbus/dbus-errors.c line 282.
This is normally a bug in some application using the D-Bus library.
libhal.c 3483 : Error unsubscribing to signals, error=The name org.freedesktop.Hal was not provided by any .service files
88: IDE 00.0: 10600 Disk
  [Created at block.243]
  Unique ID: 3OOL.cxF1BuTlEDD
  Parent ID: w7Y8.mL+OcbU+PEA
  SysFS ID: /class/block/sda
  SysFS BusID: 0:0:0:0
  SysFS Device Link: /devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0
  Hardware Class: disk
  Model: "ST9250610NS"
  Device: "ST9250610NS"
  Revision: "SN01"
  Serial ID: "9XE00BTT"
  Driver: "ahci", "sd"
  Driver Modules: "ahci"
  Device File: /dev/sda
  Device Files: /dev/sda, /dev/disk/by-id/ata-ST9250610NS_9XE00BTT, /dev/disk/by-id/scsi-SATA_ST9250610NS_9XE00BTT, /dev/disk/by-id/wwn-0x5000c50035319eee, /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0
  Device Number: block 8:0-8:15
  Geometry (Logical): CHS 30401/255/63
  Size: 488397168 sectors a 512 bytes
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #32 (SATA controller)


Drive Group Information, Disk behind RAID card
  • sg3_utils
root@ubuntu:~$ sudo apt-get install sg3-utils
root@ubuntu:~$ sg_map
/dev/sg0  /dev/sda
/dev/sg1
/dev/sg2  /dev/sdb
/dev/sg3  /dev/sdc
/dev/sg4  /dev/sdd
/dev/sg5  /dev/sde
/dev/sg6  /dev/sdf
/dev/sg7  /dev/sdg
/dev/sg8  /dev/sdh
/dev/sg9  /dev/sdi


root@ubuntu:~$ sginfo /dev/sg0
INQUIRY response (cmd: 0x12)
----------------------------
Device Type                        0
Vendor:                    ATA
Product:                   ST9250610NS
Revision level:            SN01



  • MegaRAID 資訊

http://www.lsi.com/channel/products/storagecomponents/Pages/6GBSATA_SASRAIDCards.aspx
http://store.lsi.com/store.cfm/MegaRAID_Controllers/9260_Controllers/LSI00201/
http://www.lsi.com/channel/products/storagecomponents/Pages/MegaRAIDSAS9260-4i.aspx

root@ubuntu:~$ modinfo megaraid_sas
filename:       /lib/modules/3.2.0-23-generic/kernel/drivers/scsi/megaraid/megaraid_sas.ko
description:    LSI MegaRAID SAS Driver
author:         megaraidlinux@lsi.com
version:        00.00.06.12-rc1
license:        GPL
srcversion:     B0EE8D562F66C8547CAF07E
alias:          pci:v00001000d0000005Dsv*sd*bc*sc*i*
alias:          pci:v00001000d0000005Bsv*sd*bc*sc*i*
alias:          pci:v00001028d00000015sv*sd*bc*sc*i*
alias:          pci:v00001000d00000413sv*sd*bc*sc*i*
alias:          pci:v00001000d00000071sv*sd*bc*sc*i*
alias:          pci:v00001000d00000073sv*sd*bc*sc*i*
alias:          pci:v00001000d00000079sv*sd*bc*sc*i*
alias:          pci:v00001000d00000078sv*sd*bc*sc*i*
alias:          pci:v00001000d0000007Csv*sd*bc*sc*i*
alias:          pci:v00001000d00000060sv*sd*bc*sc*i*
alias:          pci:v00001000d00000411sv*sd*bc*sc*i*
depends:
intree:         Y
vermagic:       3.2.0-23-generic SMP mod_unload modversions
parm:           poll_mode_io:Complete cmds from IO path, (default=0) (int)
parm:           max_sectors:Maximum number of sectors per IO command (int)
parm:           msix_disable:Disable MSI-X interrupt handling. Default: 0 (int)

根據 smartctl 的說明, 應該用 3ware or megaraid 這兩個參數就可以看到後面的硬碟才對.. 不過還沒試成功
root@ubuntu:~$ smartctl -a -d 3ware,0 /dev/sd1
root@ubuntu:~$ smartctl -a -d megaraid,0 /dev/sd1

最後用了 LSI 官網的工具 MegaCli
http://lzj0470.iteye.com/blog/1399221
http://www.osslab.com.tw/index.php?title=Storage/Enterprise/SAS%E8%88%87RAID/LSI
http://www.osslab.com.tw/Storage/Enterprise/SAS%E8%88%87RAID/LSI/MegaRAID_CLI%E7%B0%A1%E4%BB%8B
http://www.weithenn.org/cgi-bin/wiki.pl?MegaCLI-%E6%9F%A5%E7%9C%8B_PERC_5i_RAID_Controller_%E7%8B%80%E6%85%8B#Heading10

不過要注意的是這個工具不支援 3.0 以後的 Kernel, 但我在 Ubuntu 官網找到暫解
http://askubuntu.com/questions/112455/megaraid-sas-raid-controller

指令集
http://kb.lsi.com/KnowledgebaseArticle16516.aspx

root@ubuntu:~$ unzip 8.02.21_MegaCLI.zip
root@ubuntu:~$ cd 8.02.21_Linux_MegaCLI
root@ubuntu:~8.02.21_Linux_MegaCLI$ unzip MegaCliLin.zip
root@ubuntu:~8.02.21_Linux_MegaCLI$ sudo apt-get install alien
root@ubuntu:~8.02.21_Linux_MegaCLI$ alien -k Lib_Utils-1.00-09.noarch.rpm
lib-utils_1.00-09_all.deb generated
root@ubuntu:~8.02.21_Linux_MegaCLI$ alien -k MegaCli-8.02.21-1.noarch.rpm
megacli_8.02.21-1_all.deb generated
root@ubuntu:~8.02.21_Linux_MegaCLI$ dpkg -i *.deb
root@ubuntu:~8.02.21_Linux_MegaCLI$ cd /opt/MegaRAID/MegaCli/
root@ubuntu:/opt/MegaRAID/MegaCli$ sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -v


      MegaCLI SAS RAID Management Tool  Ver 8.02.21 Oct 21, 2011

    (c)Copyright 2011, LSI Corporation, All Rights Reserved.

Exit Code: 0x00
root@ubuntu:/opt/MegaRAID/MegaCli$ sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -adpCount


Controller Count: 1.

Exit Code: 0x01
root@ubuntu:/opt/MegaRAID/MegaCli$ sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL
Enclosure Device ID: 12
Slot Number: 8
Drive's postion: DiskGroup: 3, Span: 0, Arm: 2
Enclosure position: 0
Device Id: 15
WWN: 50024E920543493B
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA
Raw Size: 931.512 GB [0x74706db0 Sectors]
Non Coerced Size: 931.012 GB [0x74606db0 Sectors]
Coerced Size: 931.0 GB [0x74600000 Sectors]
Firmware state: Online, Spun Up
Device Firmware Level: 0001
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x5000ae40000168ae
Connected Port Number: 0(path0)
Inquiry Data: S2JBJ9BB500090      SAMSUNG HE103SJ                         1AJ10001
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 3.0Gb/s
Link Speed: 3.0Gb/s
Media Type: Hard Disk Device
Drive Temperature : N/A
PI Eligibility:  No
Drive is formatted for PI information:  No
PI: No PI
Drive's write cache : Disabled
Drive's NCQ setting : Disabled
Port-0 :
Port status: Active
Port's Linkspeed: 3.0Gb/s
Drive has flagged a S.M.A.R.T alert : No

root@ubuntu:/opt/MegaRAID/MegaCli$ sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll
Virtual Drive: 3 (Target Id: 3)
Name                :
RAID Level          : Primary-5, Secondary-0, RAID Level Qualifier-3
Size                : 1.818 TB
Parity Size         : 931.0 GB
State               : Optimal
Strip Size          : 64 KB
Number Of Drives    : 3
Span Depth          : 1
Default Cache Policy: WriteThrough, ReadAdaptive, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteThrough, ReadAdaptive, Direct, No Write Cache if Bad BBU
Default Access Policy: Read/Write
Current Access Policy: Read/Write
Disk Cache Policy   : Disk's Default
Encryption Type     : None
Is VD Cached: No

root@ubuntu:/opt/MegaRAID/MegaCli$ sudo setarch x86_64 --uname-2.6 /opt/MegaRAID/MegaCli/MegaCli64 -h

      MegaCLI SAS RAID Management Tool  Ver 8.02.21 Oct 21, 2011

    (c)Copyright 2011, LSI Corporation, All Rights Reserved.


NOTE: The following options may be given at the end of any command below:

    [-Silent] [-AppLogFile filename] [-NoLog] [-page[N]]
                 [-] is optional.
                  N - Number of lines per page.

MegaCli -v
MegaCli -help|-h|?
MegaCli -adpCount
MegaCli -AdpSetProp {CacheFlushInterval -val} | { RebuildRate -val}
    | {PatrolReadRate -val} | {BgiRate -val} | {CCRate -val} | {ForceSGPIO -val}
    | {ReconRate -val} | {SpinupDriveCount -val} | {SpinupDelay -val}
    | {CoercionMode -val} | {ClusterEnable -val} | {PredFailPollInterval -val}
    | {BatWarnDsbl -val} | {EccBucketSize -val} | {EccBucketLeakRate -val}
    | {AbortCCOnError -val} | AlarmEnbl | AlarmDsbl | AlarmSilence
    | {SMARTCpyBkEnbl -val} | {SSDSMARTCpyBkEnbl -val} | NCQEnbl | NCQDsbl
    | {MaintainPdFailHistoryEnbl -val} | {RstrHotSpareOnInsert -val}
    | {DisableOCR -val} | {BootWithPinnedCache -val} | {enblPI -val} |{PreventPIImport -val}
    | AutoEnhancedImportEnbl | AutoEnhancedImportDsbl
    | {EnblSpinDownUnConfigDrvs -val}|{UseDiskActivityforLocate -val} -aN|-a0,1,2|-aALL
    | {ExposeEnclDevicesEnbl -val} | {SpinDownTime -val}
    | {SpinUpEncDrvCnt -val} | {SpinUpEncDelay -val} | {Perfmode -val} -aN|-a0,1,2|-aALL
MegaCli -AdpSetProp -AutoDetectBackPlaneDsbl -val -aN|-a0,1,2|-aALL
       val - 0=Enable Auto Detect of SGPIO and i2c SEP.
             1=Disable Auto Detect of SGPIO.
             2=Disable Auto Detect of i2c SEP.
             3=Disable Auto Detect of SGPIO and i2c SEP.
MegaCli -AdpSetProp -CopyBackDsbl -val -aN|-a0,1,2|-aALL
       val - 0=Enable Copyback.
             1=Disable Copyback.
MegaCli -AdpSetProp -EnableJBOD -val -aN|-a0,1,2|-aALL
       val - 0=Disable JBOD mode.
             1=Enable JBOD mode.
MegaCli -AdpSetProp -DsblCacheBypass -val -aN|-a0,1,2|-aALL
       val - 0=Enable Cache Bypass.
             1=Disable Cache Bypass.
MegaCli -AdpSetProp -LoadBalanceMode -val -aN|-a0,1,2|-aALL
       val - 0=Auto Load balance mode.
             1=Disable Load balance mode.
MegaCli -AdpSetProp -UseFDEOnlyEncrypt -val -aN|-a0,1,2|-aALL
       val - 0=FDE and controller encryption (if HW supports) is allowed.
             1=Only support FDE encryption, disallow controller encryption.
MegaCli -AdpSetProp -PrCorrectUncfgdAreas -val -aN|-a0,1,2|-aALL
       val - 0= Correcting Media error during PR is disabled.
             1=Correcting Media error during PR is allowed.
MegaCli -AdpSetProp -DsblSpinDownHSP -val -aN|-a0,1,2|-aALL
       val - 0= Spinning down the Hot Spare is enabled.
             1=Spinning down the Hot Spare is disabled.
MegaCli -AdpSetProp -DefaultLdPSPolicy -Automatic| -None | -Maximum| -MaximumWithoutCaching -aN|-a0,1,2|-aALL
MegaCli -AdpSetProp -DisableLdPS -interval n1 -time n2 -aN|-a0,1,2|-aALL
       where n1 is the number of hours beginning at time n2
       where n2 is the number of minutes from 12:00am
MegaCli -AdpSetProp -ENABLEEGHSP -val -aN|-a0,1,2|-aALL
           val - 0= Disabled Emergency GHSP.
                         1= Enabled Emergency GHSP.
MegaCli -AdpSetProp -ENABLEEUG -val -aN|-a0,1,2|-aALL
           val - 0= Disabled Emergency UG as Spare.
                         1= Enabled Emergency UG as Spare.
MegaCli -AdpSetProp -ENABLEESMARTER -val -aN|-a0,1,2|-aALL
           val - 0= Disabled Emergancy Spare as Smarter.
                         1= Enabled Emergancy Spare as Smarter.
MegaCli -AdpSetProp -DPMenable -val -aN|-a0,1,2|-aALL
       val - 0=Disable Drive Performance Monitoring .
             1=Enable Drive Performance Monitoring.
MegaCli -AdpSetProp -SupportSSDPatrolRead -val -aN|-a0,1,2|-aALL
       val - 0=Disable Patrol read for SSD drives .
             1=Enable Patrol read for SSD drives.
MegaCli -AdpGetProp CacheFlushInterval | RebuildRate | PatrolReadRate | ForceSGPIO
    | BgiRate | CCRate | ReconRate | SpinupDriveCount | SpinupDelay
    | CoercionMode | ClusterEnable | PredFailPollInterval | BatWarnDsbl
    | EccBucketSize | EccBucketLeakRate | EccBucketCount | AbortCCOnError
    | AlarmDsply | SMARTCpyBkEnbl | SSDSMARTCpyBkEnbl | NCQDsply
    | MaintainPdFailHistoryEnbl | RstrHotSpareOnInsert
    | EnblSpinDownUnConfigDrvs  | DisableOCR
    | BootWithPinnedCache | enblPI  |PeventPIImport | AutoEnhancedImportDsply | AutoDetectBackPlaneDsbl
    | CopyBackDsbl | LoadBalanceMode | UseFDEOnlyEncrypt | WBSupport | EnableJBOD
    | DsblCacheBypass | ExposeEnclDevicesEnbl | SpinDownTime | PrCorrectUncfgdAreas
    | UseDiskActivityforLocate | ENABLEEGHSP | ENABLEEUG | ENABLEESMARTER | Perfmode | -DPMenable -aN|-a0,1,2|-aALL
    | DefaultLdPSPolicy | DisableLdPsInterval | DisableLdPsTime | SpinUpEncDrvCnt
    | SpinUpEncDelay | PrCorrectUncfgdAreas
    | DsblSpinDownHSP | SupportSSDPatrolRead -aN|-a0,1,2|-aALL
MegaCli -AdpAllInfo -aN|-a0,1,2|-aALL
MegaCli -AdpGetTime -aN|-a0,1,2|-aALL
MegaCli -AdpSetTime yyyymmdd hh:mm:ss -aN
MegaCli -AdpSetVerify -f fileName -aN|-a0,1,2|-aALL
MegaCli -AdpBIOS -Enbl |-Dsbl | -SOE | -BE | EnblAutoSelectBootLd | DsblAutoSelectBootLd | -Dsply -aN|-a0,1,2|-aALL
MegaCli -AdpBootDrive {-Set {-Lx | -physdrv[E0:S0]}} | {-Unset {-Lx | -physdrv[E0:S0]}} |-Get -aN|-a0,1,2|-aALL
MegaCli -AdpAutoRbld -Enbl|-Dsbl|-Dsply -aN|-a0,1,2|-aALL
MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL
MegaCli -AdpPR -Dsbl|EnblAuto|EnblMan|Start|Suspend|Resume|Stop|Info|SSDPatrolReadEnbl |SSDPatrolReadDsbl
         |{SetDelay Val}|{-SetStartTime yyyymmdd hh}|{maxConcurrentPD Val} -aN|-a0,1,2|-aALL
MegaCli -AdpCcSched -Dsbl|-Info|{-ModeConc | -ModeSeq [-ExcludeLD -LN|-L0,1,2]
   [-SetStartTime yyyymmdd hh ] [-SetDelay val ] } -aN|-a0,1,2|-aALL
MegaCli -AdpCcSched -SetStartTime yyyymmdd hh -aN|-a0,1,2|-aALL
MegaCli -AdpCcSched -SetDelay val  -aN|-a0,1,2|-aALL
MegaCli -FwTermLog -BBUoff|BBUoffTemp|BBUon|BBUGet|Dsply|Clear -aN|-a0,1,2|-aALL
MegaCli -AdpAlILog -aN|-a0,1,2|-aALL
MegaCli -AdpDiag [val] -aN|-a0,1,2|-aALL
          val - Time in second.
MegaCli -AdpGetPciInfo -aN|-a0,1,2|-aALL
MegaCli -AdpShutDown -aN|-a0,1,2|-aALL
MegaCli -PDList -aN|-a0,1,2|-aALL
MegaCli -PDGetNum -aN|-a0,1,2|-aALL
MegaCli -pdInfo -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PDOnline  -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PDOffline -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PDMakeGood -PhysDrv[E0:S0,E1:S1,...] | [-Force] -aN|-a0,1,2|-aALL
MegaCli -PDMakeJBOD -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PDHSP {-Set [-Dedicated [-ArrayN|-Array0,1,2...]] [-EnclAffinity] [-nonRevertible]}
     |-Rmv -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PDRbld -Start|-Stop|-Suspend|-Resume|-ShowProg |-ProgDsply
        -PhysDrv [E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PDClear -Start|-Stop|-ShowProg |-ProgDsply
        -PhysDrv [E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PdLocate {[-start] | -stop} -physdrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PdMarkMissing -physdrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL
MegaCli -PdGetMissing -aN|-a0,1,2|-aALL
MegaCli -PdReplaceMissing -physdrv[E0:S0] -arrayA, -rowB -aN
MegaCli -PdPrpRmv [-UnDo] -physdrv[E0:S0] -aN|-a0,1,2|-aALL
MegaCli -EncInfo -aN|-a0,1,2|-aALL
MegaCli -EncStatus -aN|-a0,1,2|-aALL
MegaCli -PhyInfo -phyM -aN|-a0,1,2|-aALL
MegaCli -PhySetLinkSpeed -phyM -speed -aN|-a0,1,2|-aALL
MegaCli -PdFwDownload [offline][ForceActivate] {[-SataBridge] -PhysDrv[0:1] }|{-EncdevId[devId1]} -f <filename> -aN|-a0,
1,2|-aALL
MegaCli -LDInfo -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
MegaCli -LDSetProp  {-Name LdNamestring} | -RW|RO|Blocked|RemoveBlocked | WT|WB|ForcedWB [-Immediate] |RA|NORA|ADRA
        | Cached|Direct | -EnDskCache|DisDskCache | CachedBadBBU|NoCachedBadBBU
        -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
MegaCli -LDSetPowerPolicy -Default| -Automatic| -None| -Maximum| -MaximumWithoutCaching
        -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
MegaCli -LDGetProp  -Cache | -Access | -Name | -DskCache | -PSPolicy | Consistency -Lx|-L0,1,2|-LALL
        -aN|-a0,1,2|-aALL
MegaCli -LDInit {-Start [-full]}|-Abort|-ShowProg|-ProgDsply -Lx|-L0,1,2|-LALL -aN|-a0,1,2|-aALL
MegaCli -LDCC {-Start [-force]}|-Abort|-Suspend|-Resume|-ShowProg|-ProgDsply -Lx|-L0,1,2|-LALL -aN|-a0,1,2|-aALL
MegaCli -LDBI -Enbl|-Dsbl|-getSetting|-Abort|-Suspend|-Resume|-ShowProg|-ProgDsply -Lx|-L0,1,2|-LALL -aN|-a0,1,2|-aALL
MegaCli -LDRecon {-Start -rX [{-Add | -Rmv} -Physdrv[E0:S0,...]]}|-ShowProg|-ProgDsply
        -Lx -aN
MegaCli -LdPdInfo -aN|-a0,1,2|-aALL
MegaCli -LDGetNum -aN|-a0,1,2|-aALL
MegaCli -LDBBMClr -Lx|-L0,1,2,...|-Lall -aN|-a0,1,2|-aALL
MegaCli -getLdExpansionInfo -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
MegaCli -LdExpansion -pN -dontExpandArray -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
MegaCli -GetBbtEntries -Lx|-L0,1,2|-Lall -aN|-a0,1,2|-aALL
MegaCli -Cachecade -assign|-remove -Lx|-L0,1,2|-LALL -aN|-a0,1,2|-aALL
MegaCli -CfgLdAdd -rX[E0:S0,E1:S1,...] [WT|WB] [NORA|RA|ADRA] [Direct|Cached]
        [CachedBadBBU|NoCachedBadBBU] [-szXXX [-szYYY ...]]
        [-strpszM] [-Hsp[E0:S0,...]] [-AfterLdX] [-Force]|[FDE|CtrlBased]
                [-Default| -Automatic| -None| -Maximum| -MaximumWithoutCaching] [-Cache] [-enblPI]-aN
MegaCli -CfgCacheCadeAdd [-rX] -Physdrv[E0:S0,...] {-Name LdNamestring} [WT|WB|ForcedWB] [-assign -LX|L0,2,5..|LALL] -aN|-a0,1,2|-aALL
MegaCli -CfgEachDskRaid0 [WT|WB] [NORA|RA|ADRA] [Direct|Cached]
        [CachedBadBBU|NoCachedBadBBU] [-strpszM]|[FDE|CtrlBased] [-Default| -Automatic| -None| -Maximum| -MaximumWithoutCaching] [-Cache] -aN|-a0,1,2|-aALL
MegaCli -CfgClr [-Force] -aN|-a0,1,2|-aALL
MegaCli -CfgDsply -aN|-a0,1,2|-aALL
MegaCli -CfgCacheCadeDsply -aN|-a0,1,2|-aALL
MegaCli -CfgLdDel -LX|-L0,2,5...|-LALL [-Force] -aN|-a0,1,2|-aALL
MegaCli -CfgCacheCadeDel -LX|-L0,2,5...|-LALL -aN|-a0,1,2|-aALL
MegaCli -CfgFreeSpaceinfo -aN|-a0,1,2|-aALL
MegaCli -CfgSpanAdd -r10 -Array0[E0:S0,E1:S1] -Array1[E0:S0,E1:S1] [-ArrayX[E0:S0,E1:S1] ...]
        [WT|WB] [NORA|RA|ADRA] [Direct|Cached] [CachedBadBBU|NoCachedBadBBU]
        [-szXXX[-szYYY ...]][-strpszM][-AfterLdX][-Force]|[FDE|CtrlBased]
                [-Default| -Automatic| -None| -Maximum| -MaximumWithoutCaching] [-Cache] [-enblPI] -aN
MegaCli -CfgSpanAdd -r50 -Array0[E0:S0,E1:S1,E2:S2,...] -Array1[E0:S0,E1:S1,E2:S2,...]
        [-ArrayX[E0:S0,E1:S1,E2:S2,...] ...] [WT|WB] [NORA|RA|ADRA] [Direct|Cached]
        [CachedBadBBU|NoCachedBadBBU][-szXXX[-szYYY ...]][-strpszM][-AfterLdX][-Force]|
        [FDE|CtrlBased] [-Default| -Automatic| -None| -Maximum| -MaximumWithoutCaching] [-Cache] [-enblPI] -aNMegaCli -CfgSpanAdd -r60 -Array0[E0:S0,E1:S1,E2:S2,E3,S3...] -Array1[E0:S0,E1:S1,E2:S2,E3,S3...]
        [-ArrayX[E0:S0,E1:S1,E2:S2,E3,S3...] ...] [WT|WB] [NORA|RA|ADRA] [Direct|Cached]
        [CachedBadBBU|NoCachedBadBBU][-szXXX[-szYYY ...]][-strpszM][-AfterLdX][-Force]|
        [FDE|CtrlBased] [-Default| -Automatic| -None| -Maximum| -MaximumWithoutCaching] [-Cache] [-enblPI] -aNMegaCli -CfgAllFreeDrv -rX [-SATAOnly] [-SpanCount XXX] [WT|WB] [NORA|RA|ADRA]
        [Direct|Cached] [CachedBadBBU|NoCachedBadBBU] [-strpszM]
        [-HspCount XX [-HspType -Dedicated|-EnclAffinity|-nonRevertible]]|
        [FDE|CtrlBased] [-Default| -Automatic| -None| -Maximum| -MaximumWithoutCaching] [-Cache] [-enblPI] -aN
MegaCli -CfgSave -f filename -aN
MegaCli -CfgRestore -f filename -aN
MegaCli -CfgForeign -Scan | [-SecurityKey sssssssssss] -aN|-a0,1,2|-aALL
MegaCli -CfgForeign -Dsply [x] | [-SecurityKey sssssssssss] -aN|-a0,1,2|-aALL
MegaCli -CfgForeign -Preview [x] | [-SecurityKey sssssssssss] -aN|-a0,1,2|-aALL
MegaCli -CfgForeign -Import [x] | [-SecurityKey sssssssssss] -aN|-a0,1,2|-aALL
MegaCli -CfgForeign -Clear [x]|[-SecurityKey sssssssssss] -aN|-a0,1,2|-aALL
        x - index of foreign configurations. Optional. All by default.
MegaCli -AdpEventLog -GetEventLogInfo -aN|-a0,1,2|-aALL
MegaCli -AdpEventLog -GetEvents {-info -warning -critical -fatal} {-f <filename>} -aN|-a0,1,2|-aALL
MegaCli -AdpEventLog -GetSinceShutdown {-info -warning -critical -fatal} {-f <filename>} -aN|-a0,1,2|-aALL
MegaCli -AdpEventLog -GetSinceReboot {-info -warning -critical -fatal} {-f <filename>} -aN|-a0,1,2|-aALL
MegaCli -AdpEventLog -IncludeDeleted {-info -warning -critical -fatal} {-f <filename>} -aN|-a0,1,2|-aALL
MegaCli -AdpEventLog -GetLatest n {-info -warning -critical -fatal} {-f <filename>} -aN|-a0,1,2|-aALL
MegaCli -AdpEventLog -GetCCIncon -f <filename> -LX|-L0,2,5...|-LALL -aN|-a0,1,2|-aALL
MegaCli -AdpEventLog -Clear -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -GetBbuStatus -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -GetBbuCapacityInfo -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -GetBbuDesignInfo -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -GetBbuProperties -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -BbuLearn -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -BbuMfgSleep -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -BbuMfgSeal -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -getBbumodes  -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -SetBbuProperties -f <filename> -aN|-a0,1,2|-aALL
MegaCli -AdpBbuCmd -GetGGEEPData offset [Hexaddress] NumBytes n -aN|-a0,1,2|-aALL
MegaCli -AdpFacDefSet -aN
MegaCli -AdpFwFlash -f filename [-NoSigChk] [-NoVerChk] [-FWTYPE n] -aN|-a0,1,2|-aALL
MegaCli -AdpGetConnectorMode -ConnectorN|-Connector0,1|-ConnectorAll -aN|-a0,1,2|-aALL
MegaCli -AdpSetConnectorMode -Internal|-External|-Auto -ConnectorN|-Connector0,1|-ConnectorAll -aN|-a0,1,2|-aALL
MegaCli -PhyErrorCounters -aN|-a0,1,2|-aALL
MegaCli -DirectPdMapping -Enbl|-Dsbl|-Dsply -aN|-a0,1,2|-aALL
MegaCli -PDCpyBk -Start -PhysDrv[E0:S0,E1:S1] -aN|-a0,1,2|-aALL
MegaCli -PDCpyBk -Stop|-Suspend|-Resume|-ShowProg|-ProgDsply -PhysDrv[E0:S0] -aN|-a0,1,2|-aALL
MegaCli -PDInstantSecureErase -PhysDrv[E0:S0,E1:S1,...] | [-Force] -aN|-a0,1,2|-aALL
MegaCli -CfgSpanAdd -rX -array0[E0:S1,E1:S1.....] array1[E0:S1,E1:S1.....] -szxxx -enblPI -aN|-a0,1,2|-aALL
MegaCli -AdpSetVerify -f verify.txt -aN|-a0,1,2|-aALL
MegaCli -LDMakeSecure -Lx|-L0,1,2,...|-Lall -aN|-a0,1,2|-aALL
MegaCli -DestroySecurityKey | [-Force] -aN
MegaCli -CreateSecurityKey -SecurityKey sssssssssss | [-Passphrase sssssssssss] |[-KeyID kkkkkkkkkkk] -aN
MegaCli -CreateSecurityKey useEKMS -aN
MegaCli -ChangeSecurityKey -OldSecurityKey sssssssssss | -SecurityKey sssssssssss|
          [-Passphrase sssssssssss] | [-KeyID kkkkkkkkkkk] -aN
MegaCli -ChangeSecurityKey -SecurityKey sssssssssss|
          [-Passphrase sssssssssss] | [-KeyID kkkkkkkkkkk] -aN
MegaCli -ChangeSecurityKey useEKMS -OldSecurityKey sssssssssss -aN
MegaCli -GetKeyID [-PhysDrv[E0:S0]] -aN
MegaCli -SetKeyID -KeyID kkkkkkkkkkk -aN
MegaCli -VerifySecurityKey -SecurityKey sssssssssss -aN
MegaCli -GetPreservedCacheList -aN|-a0,1,2|-aALL
MegaCli -DiscardPreservedCache -Lx|-L0,1,2|-Lall -force -aN|-a0,1,2|-aALL

       sssssssssss  - It must be between eight and thirty-two
                      characters and contain at least one number,
                      one lowercase letter, one uppercase
                      letter and one non-alphanumeric character.
       kkkkkkkkkkk -  Must be less than 256 characters.
MegaCli -ShowSummary [-f filename] -aN
MegaCli -ELF -GetSafeId -aN|-a0,1,2|-aALL
MegaCli -ELF -ControllerFeatures -aN|-a0,1,2|-aALL
MegaCli -ELF -Applykey key <-val> [Preview] -aN|-a0,1,2|-aALL
MegaCli -ELF -TransferToVault -aN|-a0,1,2|-aALL
MegaCli -ELF -DeactivateTrialKey -aN|-a0,1,2|-aALL
MegaCli -ELF -ReHostInfo -aN|-a0,1,2|-aALL
MegaCli -ELF -ReHostComplete -aN|-a0,1,2|-aALL
MegaCli -LDViewMirror -Lx|-L0,1,2,...|-Lall -aN|-a0,1,2|-aALL
MegaCli -LDJoinMirror -DataSrc <val> [-force] -Lx|-L0,1,2,...|-Lall -aN|-a0,1,2|-aALL
MegaCli -SecureErase
        Start[
                Simple|
                [Normal   [ |ErasePattern ErasePatternA|ErasePattern ErasePatternA ErasePattern ErasePatternB]]|
                [Thorough [ |ErasePattern ErasePatternA|ErasePattern ErasePatternA ErasePattern ErasePatternB]]]
        | Stop
        | ShowProg
        | ProgDsply
        [-PhysDrv [E0:S0,E1:S1,...] | -Lx|-L0,1,2|-LALL] -aN|-a0,1,2|-aALL
MegaCli -Version -Cli|-Ctrl|-Driver|-Pd   -aN|-a0,1,2|-aALL
MegaCli -Perfmon {-start -interval <val>} | {stop} | {-getresults -f <filename>} -aN
MegaCli -DpmStat -Dsply {lct | hist | ra | ext } [-physdrv[E0:S0]] -aN|-a0,1,2|-aALL
MegaCli -DpmStat -Clear {lct | hist | ra | ext } -aN|-a0,1,2|-aALL

    Note: The directly connected drives can be specified as [:S]

    Wildcard '?' can be used to specify the enclosure ID for the drive in the
      only enclosure without direct connected device or the direct connected
      drives with no enclosure in the system.

      Note:[-aALL] option assumes that the parameters specified are valid
       for all the Adapters.

    The following options may be given at the end of any command above:

    [-Silent] [-AppLogFile filename] [-NoLog] [-page[N]]
                 [-] is optional.
                  N - Number of lines per page.




Reference:
http://www.cyberciti.biz/faq/find-hard-disk-hardware-specs-on-linux/
http://www.cyberciti.biz/tips/sdparm-linux-scsi-device-attribute.html
http://unix.stackexchange.com/questions/5085/how-to-see-disk-details-like-manufacturer-in-linux
http://freejabber.com/2012/01/30/monitoring-your-raid-array-drives-and-standalone-drives-in-ubuntu-linux-using-smartmontools/
http://www.cyberciti.biz/faq/unix-linux-freebsd-3w-9xxx-smartctl-check-hard-disk-command/

Advanced Python or Understanding Python 筆記



http://video.google.com/videoplay?docid=7760178035196894549

Inner Function (7:00)


從下面這個範例可以看的出來 inner_func 的生成時機, 以及 local variable 的 scope

inner_func 在 def 的時機就生成出來, parameter 也在此時生成, 所以 arg3 = 2, 更精準一點解釋的是指向和 arg2 一樣的物件
但裡面的程式碼在這個時間不會被執行, 即使語法有錯也不會被發現, 唯一做的動作只是把它打包進去 inner_func

等到要執行時, 因為 arg1 在 Local 找不到, 所以會往 Enclose 找, 但在這個時間點, arg1 早已被 assign 成 None,

>>> def func(arg1, arg2):
...    def inner_func(arg3=arg2):
...        print "Enter inner"
...        return arg1, arg3
...    arg1 = arg2 = None
...    return inner_func
>>> t = func(1,2)
>>> t()
(None, 2)



Python Scope (12:00)

採取 LEGB 原則 (Local -> Enclose -> Global -> Bullin)
只有 Local variable 是 R/w, 其他的都是 read-only , 一但你試著去改變 outer variable
intepreter 會直接幫你生成一個 local variable, 然後把值塞進去
唯一例外是你宣告 global var1, 那你才可以去改變它的值


Actual constructor __new__ (48:30)

  • __new__ is staticmethod, called before object created
  • __init__ is instancemethod, called after object created
     有了這個, Singleton 從這邊下手即可

     More explain: http://stackoverflow.com/questions/674304/pythons-use-of-new-and-init


Metaclasses (55:00)

累了... 聽不太懂.. 有機會再弄懂, 看起來有點像 template. 但我對 template  一向一太熟 Orz
More explain: http://www.slideshare.net/jmgimeno/metaclass-programming-in-python


Other Reference:

Performance tuning
http://www.slideshare.net/hongqn/python-9915982






2012年4月26日 星期四

Use phpMyAdmin to access your mysql database

除了 HeidiSQL 之外, 還找到一個好用的軟體 phpMyAdmin, 他的方便性是把資料用網頁呈現, 所以你的電腦基本上不需要裝任何東西就可以使用了, 相對的, 他的功能可能沒有 HeidiSQL 這麼多, 但如果只是要快速查看, 倒是一個不錯的選擇


如果是在 Ubuntu 安裝, 請記得要先裝 mysql 及 apache/lighttpd
一個指令下下去之後, 他會先要求你輸入 MySQL 的 root 密碼, 之後他會 create 一個 phpmyadmin 帳號, 也要輸入相對應的密碼
接下來他會要求你選擇用 Apache or lighttpd, 這個就看個人選擇

openstack@ubuntu:~$ sudo apt-get install phpmyadmin
Processing triggers for man-db ...
Setting up phpmyadmin (4:3.4.10.1-1) ...
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf

Creating config file /etc/dbconfig-common/phpmyadmin.conf with new version

Creating config file /etc/phpmyadmin/config-db.php with new version
granting access to database phpmyadmin for phpmyadmin@localhost: success.
verifying access for phpmyadmin@localhost: success.
creating database phpmyadmin: success.
verifying database phpmyadmin exists: success.
populating database via sql...  done.
dbconfig-common: flushing administrative password
 * Reloading web server config apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
   ...done.


之後你就可以透過  http://x.x.x.x/phpmyadmin 來操作囉!
帳號可以使用  root, 也可以使用  phpmyadmin, 總之 mysql 裡面有的帳號你都可以使用,
很方便吧!





Use MySQL Workbench to draw database scheme

要了解  open souce, 也一定要把它的  database 的結構翻出來看看
找了一下, 發現 MySQL Workbench 有自動把  database 的結構畫出來的功能
(雖然他好像還有更多功能.. 但以後再研究吧~)

必須要先安裝的東西, 感覺很肥呀~
http://dev.mysql.com/resources/wb52_prerequisites.html

Workbench下載點:

裝好之後先建立一個連線, 跟前一篇一樣, 利用 SSH 連線來避開無法用 root 登入的問題


連進去之後, 選  database -> Reverse Engineer (CTRL + R), 就可以開始解析你要觀察的 dabase, 沒幾分鐘, 漂亮的圖就出來了.


How to use HeidiSQL to connect MySQL

因為最近很需要看資料庫的內容, 實在有點受不了老是用 command line, 不容易看又容易打錯字
這邊有一個網址介紹了十個可以用的 mysql client gui tool,
http://www.freshdesignweb.com/10top-mysql-client-interface-gui.html

從裡面找了套免費軟體來使用 HeidiSQL
安裝完之後想要連線, 卻發現始終無法連線成功, 後來才發現似乎無法直接用 root 遠端直接登入 mysql


openstack@ubuntu:$ mysql --host 172.17.123.11 -P 3306 -uroot -ppassword
ERROR 1045 (28000): Access denied for user 'root'@'172.17.123.6' (using password: YES)

錯誤的訊息很奇妙, 我明明要連到 172.17.123.11, 卻不是連到這個 host
但如果我換別的帳號, 就可以成功連線, 不知道是不是安全性的考量, 所以會有這樣的限制
不過人生總是會找到出路的


1. 在設定上把原本的 TCP/IP 連線改成是  SSH tunnel
2. Hostname 請填入 localhost
3. 然後輸入 mysql 的帳號及密碼


1. 然後在  SSH Cunnel 這邊設定好 plink 的路徑
2. SSH host + port 記得要改成真實 ip, 他預設是前一頁的 localhost
3. 輸入 ssh 登入的帳號及密碼

這樣一來就可以順利登入啦~


補:
如果有遇到 HeidiSQL - SQL Error (2003): Can't connect to MySQL server on 'localhost' (10061)
請參考這個網頁的說明   http://www.somacon.com/p567.php
不過簡單講就是你要先用  putty.exe 成功連過主機一次後, 才能用 HeidiSQL 連線

補:
這個問題應該是 mysql 對 root 帳號有預設的連線權限限制, 不過我對這些不熟, 不知道該怎麼改, 如果有人知道再麻煩和我說一下. Thanks!






Linux udev 筆記

http://zh.wikipedia.org/wiki/Udev
  • udev 是Linux kernel 2.6系列的設備管理器, 用來接替devfs及hotplug的功能, 依賴於升級後的Linux kernel 2.6.13的uevent介面的最新版本
  • udev支持設備的固定命名,而並不依賴於設備插入系統的順序。默認的udev設置提供了存儲設備的固定命名。任何硬碟都根據其唯一的文件系統id、磁碟名稱及硬體連接的物理位置來進行識別。
  • udev完全在用戶空間執行,而不是像devfs在核心空間一樣執行
  • udev系統可以分為三個部分
    • libudev函數庫,可以用來獲取設備的信息。
    • udevd守護進程,處於用戶空間,用於管理虛擬/dev
    • 管理命令udevadm,用來診斷出錯情況。


最常被拿來配對(match)的 udev 的基本 Rules 有下面幾種.
  • KERNEL - kernel 對於裝置會有一個預設名稱如第一顆 IDE 硬碟名稱就是 hda,第一個乙太網路就是 eth0 .
  • SUBSYSTEM - 通常會指出這是什麼裝置硬碟就是 block,乙太網路就是 net.
  • DRIVER - driver 當然就是這個裝置是靠哪一個 driver(module) 在運作的.
udev 要在命名裝置時有兩種方式 NAME 和 SYMLINK.
  • NAME - 會產生唯一裝置名稱出來.
  • SYMLINK - 是一個連結到真實裝置的 symbolic links.
比對(Matching) sysfs 屬性(attributes),  SYSFS 是存在 /sys 的一個檔案值,如 SYSFS{dev} 就是儲存在 /sys///dev   ex: /sys/block/hdc/dev

也可以用 udevinfo -ap /sys/block/sda 來看所有的資訊
                 udevadm info -a -p /sys/block/sda
                 udevinfo –a –p $(udevinfo –q path –n /dev/whatever)

裝置名稱參數

%k 代表是用 kernel 名稱來命名裝置
%n 代表是用 number 來命名裝置

http://linux.die.net/man/8/udev
http://manpages.ubuntu.com/manpages/karmic/man7/udev.7.html


BUS
Match the bus type of the device
KERNEL
Match the kernel device name
ID
Match the device number on the bus
SYSFS{filename}
Match sysfs device attribute like label, vendor, USB serial number, SCSI UUID
PROGRAM
Call external program
RESULT
Match the returned string of the last PROGRAM call
NAME
The name of the node to be created
If given with the attribute NAME{all_partitions} it will create all 15 partitions of a blockdevice
SYMLINK
The name of a symlink targeting the node.
DEVPATH
Match the devpath of the event devices  (Ubuntu)
SUBSYSTEM
Match the subsystem of the event device (Ubuntu)
ATTR{filename}
Match sysfs attributes of the event device (Ubuntu)
TAG{key}
Search the devpath upwarrds for a devices with matching tag (Ubuntu)
RUN
Add a problem to the list of programs (Ubuntu)
LABEL
A name label to which a GOTO may jump
GOTO
Jumps to the next LABEL with a matching name
IMPORT{type}
Import a set of variables as device properties, depends on type (Ubuntu)

program: execute an external program

file: import a text file specified as the assigned value

Cmdline: Import a single property from the kernel command line

Parent: import the stored keys from the parent device



%n
Kernel number
%k
Kernel name
%M
Kernel major name
%m
Kernel minor name
%b
Bus id
%c
The string returned from execution of PROGRAM
%c{N}
A single part of the string, separated by a space character
%s{filename}
Content of a sysfs attribute
%3s{filename}
Only insert the first three characters of sysfs attribute
%p
The devpath of the device  (Ubuntu)
%E{key}
A device property value
%P
The node name of the parent device
%N
The name of a temporary device node created to provide access to the device from a external program before the real node is created


注意事項

在玩  udev rules 的時候, 發現了幾個重要的事情

  • PROGRAM 是立即執行
  • RUN 是先加到一串執行序列中, 等到所有的 rules 都  parse 完後, 才會執行
  • 比方說我寫了兩個 rule, 在某一個 udev event 進來時會先觸發 a.rule, 再觸發 b.rule a.rule 的內容為
    PROGRAM=="print.sh a.program"
    RUN+="print.sh a.run"
    
    b.rule 的內容為
    PROGRAM=="print.sh b.program"
    RUN+="print.sh b.run"
    
    那執行的結果應該會是
    a.program
    b.program
    a.run
    b.run
    
  • PROGRAM 是一個 Global variable, 任何新的 PROGRAM 都會改變他的值, 所以如果在 RUN 當中會使用到 %c, 就要特別注恴
  • 同樣的, 在某一個 udev event 進來時會先觸發 a.rule, 再觸發 b.rule a.rule 的內容如下 (echo.sh 是一個直接回傳第一個參數的 script)
    PROGRAM=="echo.sh a.program"
    RUN+="print.sh %c"
    
    b.rule 的內容為
    PROGRAM=="echo.sh b.program"
    
    那結果會是 b.program, 而不是 a.program, 原因是我們在 b.rules 裡面我們把 PROGRAM 的值改掉了, 所以當執行 RUN 裡面的指令時, 他使用到的是 PROGRAM 最終的值
  • 如果希望執行到目前的 rule 就停止, 不再往下執行, 可以加上 last_rule 這個 OPTION
  • OPTIONS="last_rule"
    


Network Bonding on Ubuntu 11.10

NIC Bonding and IP Aliasing on Linux
http://maxubuntu.blogspot.com/2011/07/nic-bonding-and-ip-aliasing-on-linux.html

有很清楚的表格指出  NIC Bounding 每一種模式的差異及使用方式
也有很多很棒的連結


參考文章:


Tech黑手 - 工作雜記 網卡綁定 Network Bonding
http://chunchaichang.blogspot.com/2010/08/network-bonding.html

     裡面有提到如何驗証你的網路速度

實際操作

雖然看了很多資料, 但實際在設定時還是有一些問題, 首先 Ubuntu 11.10 的設定方式和之前的版本不太相同,
有些參數 bond_xxx 也變成 bond-xxxx, 所以要注意一下自己用的 ifenslave 的版本

wistor@wistor:~$ dpkg -l | grep ifen
ii  ifenslave-2.6                      1.1.0-19ubuntu1.1                         Attach and detach slave interfaces to a bonding device

/etc/network/interface 的設定如下, 要分別就 eth0 及 eth1 設成它的 bond-master
然後 bond0 的介面就不必設定 slave, 然後在這邊我使用 active-backup 模式, 也可以用數字 1 代替
至於還有那些模式, 就請看之前的 kernel.org 那篇文章

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
        bond-master bond0

auto eth1
iface eth1 inet manual
        bond-master bond0

auto bond0
iface bond0 inet static
        address 172.17.123.81
        netmask 255.255.0.0
        gateway 172.17.1.254
        bond-slaves none
        bond-mode active-backup
        bond-miimon 100
        bond-fail-over-mac 1


wistor@wistor:~$ /etc/init.d/networking restart
wistor@wistor:~$ ifconfig
# 可以看到 bond0 有 MASTER 的字樣
# 而且可以發現 bond0 的 HWaddr 和目前 active eth0 是一樣的
bond0     Link encap:Ethernet  HWaddr 00:26:2d:0a:36:a4
          inet addr:172.17.123.81  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::226:2dff:fe0a:36a4/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:12070 errors:0 dropped:5340 overruns:0 frame:0
          TX packets:1683 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1405277 (1.4 MB)  TX bytes:222703 (222.7 KB)

# 可以看到 eth0 有 SLAVE 的字樣
eth0      Link encap:Ethernet  HWaddr 00:26:2d:0a:36:a4
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:6688 errors:0 dropped:173 overruns:0 frame:0
          TX packets:1572 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:782495 (782.4 KB)  TX bytes:210253 (210.2 KB)
          Memory:fbea0000-fbec0000

eth1      Link encap:Ethernet  HWaddr 00:26:2d:0a:36:a5
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:5382 errors:0 dropped:5150 overruns:0 frame:0
          TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:622782 (622.7 KB)  TX bytes:12450 (12.4 KB)
          Memory:fbee0000-fbf00000

# 這個指令可以看的更清楚有那些 slave 綁在 bond0 下面, 以及目前那一個是 Active
wistor@wistor:~$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:2d:0a:36:a4
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:2d:0a:36:a5
Slave queue ID: 0


如果 bonding 和 bridge 要一起使用

wistor@wistor:~$ sudo cat /etc/network/interface
iface lo inet loopback

auto eth0
iface eth0 inet manual
        bond-master bond0

auto eth1
iface eth1 inet manual
        bond-master bond0

auto bond0
iface bond0 inet manual
        bond-slaves none
        bond-mode active-backup
        bond-miimon 100
        bond-fail-over-mac 1


auto br0
iface br0 inet static
        address 172.17.123.81
        netmask 255.255.0.0
        gateway 172.17.1.254
        bridge_ports bond0

wistor@wistor:~$ sudo brctl show
bridge name     bridge id               STP enabled     interfaces
br100           8000.02163e1b9bce       no              bond0

更多的參數設定可以看 /usr/share/doc/ifenslave-2.6/README.Debian.gz


2012年4月21日 星期六

10Gb 網卡

今天要幫忙裝網卡,  一看到網卡就覺得很興奮, 因為是 10Gb 網卡, 而且還要用光纖線, 之前從沒看過, 所以就像個鄉巴佬一樣, 還拍了幾張照片起來


上網查了一下, 發現這張價值不斐, 竟然要一千多元美金, 害我手都抖了一下, 很怕掉到地上

http://www.cdw.com/shop/products/Intel-Ethernet-Converged-Network-Adapter-network-adapter-2-ports/1818390.aspx

http://ark.intel.com/zh-tw/products/39774/Intel-Ethernet-Server-Adapter-X520-SR2



總共有 2 個網孔, 裡面各有 1 個 transceiver


transceiver 是可以拔出來的, 不過我感覺很危險, 因為是靠左邊那個小拉環, 好像一不小心就會斷掉, 也上網查了一下價錢, 哇塞~也不便宜, 一個就要二百元美金, 不知道剛剛查到的一千多元美金有沒有包含這個, 如果有, 那這兩個 transceiver 加起來就佔了總價的 4 成, 難怪聽說這個東西常掉,  小小的, 又很容易拔出來, 握在手中就沒人發現了

http://www.cdw.com/shop/products/Intel-Ethernet-SFP-SR-Optics-SFP-transceiver-module/1957390.aspx?cm_sp=Product-_-Session-_-Pilot&ProgramIdentifier=3&RecommendedForEDC=1818390&RecoType=RP


這個是光纖線


上面其實有兩個塑膠套, 要拔掉後才能使用, 拔起來後會看到細細小小的內線, 聽說很脆弱, 嚴禁用手直接去碰, 這樣小小的 5m 也要 15 鎂

http://www.blackbox.co.uk/product/EFE050-KL-001M/1/5/2/OM2/Fibre-Optic-Patch-Cables/Cabling/


鄉巴佬介紹就到此結束啦~

2012年4月11日 星期三

Openstack Installation (Diablo Release) Part II

前幾天 Essex Release 已經出來了, 原本想要開始裝裝看, 不過看到官網的文件下面連發問區都還沒建立起來, 就沒有勇氣當白老鼠了

之前安裝是用手動的方式, 主要是為了了解整個安裝過程中, 每個 module 是怎麼互動的, 有什麼設定是會影響到彼此的  connection, 另外在遇到 trouble 時, 才不會完全手足無措, 不知道要怎麼解決, 今天的話決定使用官方的安裝 script

https://github.com/managedit/openstack-setup

setting 的內容
# General Settings
LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm} # Currently supports kvm or qemu

# MySQL Server Settings
# 我修改了這裡, 希望到時候新增  computer node 的時候, 其它台也能存取到這台的 dababase
# MYSQL_HOST="127.0.0.1"
MYSQL_HOST="0.0.0.0"
MYSQL_ROOT_PASS="letmein"
MYSQL_NOVA_PASS="letmeinN"
MYSQL_GLANCE_PASS="letmeinG"
MYSQL_KEYSTONE_PASS="letmeinK"
MYSQL_HORIZON_PASS="letmeinH"

# Controller Node
# 本機的 ip
HOST_IP="172.17.123.6"       # Do actually change this! This should be an IP address accessible by your end users. Not 127.0.0.1.

# Passwords
ADMIN_PASSWORD="letmein"  # Password for the "admin" user
SERVICE_TOKEN="abcdef123" # Pick something random-ish A-Za-z0-9 only. This is a password. Make it look like one.

# Networking and IPs
PUBLIC_INTERFACE="eth0"   # Interface for Floating IP traffic
# VLAN_INTERFACE="eth1"     # Interface for Fixed IP VLAN traffic
# 暫時只有一張網卡, 所以只好使用 eth0
VLAN_INTERFACE="eth0"     # Interface for Fixed IP VLAN traffic
# 每台 virtual machine 可以動態的得到一組對外的 ip, 分配的區段設在 172.17.122.1 ~ 172.17.122.254
FLOATING_RANGE="172.17.122.0/24"
# 每台 vm 內部的 ip, 希望從  192.168.128.1 開始,  所以把 RANGE_BITS 設成 17, 所以設成  16, 會變成從  192.168.0.1 開始
FIXED_RANGE_NET="192.168.128.0"
FIXED_RANGE_BITS="17"
FIXED_RANGE_MASK="255.255.0.0"
# 每 256 個 ip 變成一個 subset, 實際操作上會有什麼差別不是很清楚, 不過測試是每 256 個 ip 切出來一個 vlan 和 virtual switch
# 也就是  192.168.128.0 ~ 192.168.128.255 vlan100, br100
#        192.168.129.0 ~ 192.168.129.255 vlan101, br101
#        以此類推
FIXED_RANGE_NETWORK_SIZE="256"
# 總共 8 個 vlan
FIXED_RANGE_NETWORK_COUNT="8"


# Misc
REGION="nova"             # Region name - "nova" is the default, and probably the most reliable withoit extra setup!

# Load overrides from settings.local if it exists
if [ -f settings.local ]
then
  . settings.local
fi

# Check for kvm (hardware based virtualization).  If unable to initialize
# kvm, we drop back to the slower emulation mode (qemu).  Note: many systems
# come with hardware virtualization disabled in BIOS.
if [[ "$LIBVIRT_TYPE" == "kvm" ]]; then
    modprobe kvm || true
    if [ ! -e /dev/kvm ]; then
        LIBVIRT_TYPE=qemu
    fi
fi

# Dont change anything below here!
FIXED_RANGE="${FIXED_RANGE_NET}/${FIXED_RANGE_BITS}"
export NOVA_PROJECT_ID="admin" # Tenant
export NOVA_USERNAME="admin" # Username
export NOVA_API_KEY=$ADMIN_PASSWORD
export NOVA_URL="http://$HOST_IP:5000/v2.0/"
export NOVA_VERSION=1.1
export NOVA_REGION_NAME=$REGION

COUNT=1



安裝前必須要確認該台機器是完全乾淨的 Ubuntu 11.10 , 不然可能會遇到很多網路設定衝突的問題
另外我也稍微改寫了 clean-all.sh 原本的 script 跑完後似乎不夠乾淨, 所以如果再重裝一次 openstack (設定有改變), 會裝不起來

#!/bin/bash

killall dnsmasq
killall kvm

ifconfig br100 down
brctl delbr br100

./clean.sh

PACKAGES=`dpkg -l | grep -E "(openstack|nova|keystone|glance|swift)" | grep -v "kohana" | cut -d" " -f3 | tr "\\n" " "`

apt-get purge -y $PACKAGES

rm -rf /etc/nova /etc/glance /etc/keystone /etc/swift /etc/openstack-dashboard
rm -rf /var/lib/nova /var/lib/glance /var/lib/keystone /var/lib/swift /var/lib/openstack-dashboard
rm -rf /etc/ntp.conf

apt-get purge -y python-mysqldb mysql-client curl
apt-get purge -y mysql*
apt-get purge -y python-httplib2
apt-get purge -y rabbitmq-server
apt-get purge -y libapache2-mod-wsgi
apt-get purge -y bridge-utils
apt-get purge -y ntp
apt-get autoremove -y

安裝過程很快就結束了, 真的是輕鬆寫意, 比起之前看著安裝步驟玩了一天還裝不起來, 真的是方便多了
裝好之後, 偷偷進 mysql database 看一下,



mysql> use nova;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-------------------------------------+
| Tables_in_nova                      |
+-------------------------------------+
| agent_builds                        |
| auth_tokens                         |
| block_device_mapping                |
| certificates                        |
| compute_nodes                       |
| console_pools                       |
| consoles                            |
| export_devices                      |
| fixed_ips                           |
| floating_ips                        |
| instance_actions                    |
| instance_metadata                   |
| instance_type_extra_specs           |
| instance_types                      |
| instances                           |
| iscsi_targets                       |
| key_pairs                           |
| migrate_version                     |
| migrations                          |
| networks                            |
| projects                            |
| provider_fw_rules                   |
| quotas                              |
| security_group_instance_association |
| security_group_rules                |
| security_groups                     |
| services                            |
| snapshots                           |
| user_project_association            |
| user_project_role_association       |
| user_role_association               |
| users                               |
| virtual_interfaces                  |
| virtual_storage_arrays              |
| volume_metadata                     |
| volume_type_extra_specs             |
| volume_types                        |
| volumes                             |
| zones                               |
+-------------------------------------+
39 rows in set (0.00 sec)

mysql> select id,netmask,bridge,gateway,vlan,dhcp_start,bridge_interface from networks;
+----+---------------+--------+---------------+------+---------------+------------------+
| id | netmask       | bridge | gateway       | vlan | dhcp_start    | bridge_interface |
+----+---------------+--------+---------------+------+---------------+------------------+
|  1 | 255.255.255.0 | br100  | 192.168.128.1 |  100 | 192.168.128.3 | eth0             |
|  2 | 255.255.255.0 | br101  | 192.168.129.1 |  101 | 192.168.129.3 | eth0             |
|  3 | 255.255.255.0 | br102  | 192.168.130.1 |  102 | 192.168.130.3 | eth0             |
|  4 | 255.255.255.0 | br103  | 192.168.131.1 |  103 | 192.168.131.3 | eth0             |
|  5 | 255.255.255.0 | br104  | 192.168.132.1 |  104 | 192.168.132.3 | eth0             |
|  6 | 255.255.255.0 | br105  | 192.168.133.1 |  105 | 192.168.133.3 | eth0             |
|  7 | 255.255.255.0 | br106  | 192.168.134.1 |  106 | 192.168.134.3 | eth0             |
|  8 | 255.255.255.0 | br107  | 192.168.135.1 |  107 | 192.168.135.3 | eth0             |
+----+---------------+--------+---------------+------+---------------+------------------+
8 rows in set (0.00 sec)

# 從這個結果可以看出來網路被拆成 8 組, 彼此的網路應該是不通的, 但在管理介面上要怎麼分配就不太清楚了

mysql> show columns from floating_ips;
+---------------+--------------+------+-----+---------+----------------+
| Field         | Type         | Null | Key | Default | Extra          |
+---------------+--------------+------+-----+---------+----------------+
| created_at    | datetime     | YES  |     | NULL    |                |
| updated_at    | datetime     | YES  |     | NULL    |                |
| deleted_at    | datetime     | YES  |     | NULL    |                |
| deleted       | tinyint(1)   | YES  |     | NULL    |                |
| id            | int(11)      | NO   | PRI | NULL    | auto_increment |
| address       | varchar(255) | YES  |     | NULL    |                |
| fixed_ip_id   | int(11)      | YES  | MUL | NULL    |                |
| project_id    | varchar(255) | YES  |     | NULL    |                |
| host          | varchar(255) | YES  |     | NULL    |                |
| auto_assigned | tinyint(1)   | YES  |     | NULL    |                |
+---------------+--------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)


mysql> select id,address,host from floating_ips;
+-----+----------------+------+
| id  | address        | host |
+-----+----------------+------+
|   1 | 172.17.122.1   | NULL |
|   2 | 172.17.122.2   | NULL |
|   3 | 172.17.122.3   | NULL |
...
| 248 | 172.17.122.248 | NULL |
| 249 | 172.17.122.249 | NULL |
| 250 | 172.17.122.250 | NULL |
| 251 | 172.17.122.251 | NULL |
| 252 | 172.17.122.252 | NULL |
| 253 | 172.17.122.253 | NULL |
| 254 | 172.17.122.254 | NULL |
+-----+----------------+------+
254 rows in set (0.00 sec)


# 對外的 ip 從 172.17.122.1 ~ 172.17.122.254

mysql> show columns from fixed_ips;
+----------------------+--------------+------+-----+---------+----------------+
| Field                | Type         | Null | Key | Default | Extra          |
+----------------------+--------------+------+-----+---------+----------------+
| created_at           | datetime     | YES  |     | NULL    |                |
| updated_at           | datetime     | YES  |     | NULL    |                |
| deleted_at           | datetime     | YES  |     | NULL    |                |
| deleted              | tinyint(1)   | YES  |     | NULL    |                |
| id                   | int(11)      | NO   | PRI | NULL    | auto_increment |
| address              | varchar(255) | YES  |     | NULL    |                |
| network_id           | int(11)      | YES  | MUL | NULL    |                |
| instance_id          | int(11)      | YES  | MUL | NULL    |                |
| allocated            | tinyint(1)   | YES  |     | NULL    |                |
| leased               | tinyint(1)   | YES  |     | NULL    |                |
| reserved             | tinyint(1)   | YES  |     | NULL    |                |
| virtual_interface_id | int(11)      | YES  | MUL | NULL    |                |
| host                 | varchar(255) | YES  |     | NULL    |                |
+----------------------+--------------+------+-----+---------+----------------+
13 rows in set (0.00 sec)


mysql> select id,address,network_id,host,reserved from fixed_ips where id%256=0;
+------+-----------------+------------+------+----------+
| id   | address         | network_id | host | reserved |
+------+-----------------+------------+------+----------+
|  256 | 192.168.128.255 |          1 | NULL |        1 |
|  512 | 192.168.129.255 |          2 | NULL |        1 |
|  768 | 192.168.130.255 |          3 | NULL |        1 |
| 1024 | 192.168.131.255 |          4 | NULL |        1 |
| 1280 | 192.168.132.255 |          5 | NULL |        1 |
| 1536 | 192.168.133.255 |          6 | NULL |        1 |
| 1792 | 192.168.134.255 |          7 | NULL |        1 |
| 2048 | 192.168.135.255 |          8 | NULL |        1 |
+------+-----------------+------------+------+----------+
8 rows in set (0.01 sec)

# 對內的 ip 從 192.168.128.x 開始, 每 256 個成一組,  每一組的  .0 ~ .2 是保留的
# .3 開始才會分配給 virtual bridge 和 virtual machine

wistor@ubuntu:~$ sudo less /etc/nova/nova.conf

--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--lock_path=/var/lock/nova
--force_dhcp_release=True
--verbose
--sql_connection=mysql://nova:letmeinN@0.0.0.0/nova
--public_interface=eth1
--vlan_interface=eth1
--zone_name=nova
--node_availability_zone=nova
--storage_availability_zone=nova
--allow_admin_api=true
--enable_zone_routing=true
--api_paste_config=api-paste-keystone.ini
--vncserver_host=0.0.0.0
--vncproxy_url=http://172.17.123.81:6080
--ajax_console_proxy_url=http://172.17.123.81:8000
--glance_api_servers=172.17.123.81:9292
--s3_dmz=172.17.123.81
--ec2_host=172.17.123.81
--s3_host=172.17.123.81
--osapi_host=172.17.123.81
--rabbit_host=172.17.123.81
--dmz_net=192.168.128.0
--dmz_mask=255.255.0.0
--fixed_range=192.168.128.0/17
--keystone_ec2_url=http://172.17.123.81:5000/v2.0/ec2tokens
--multi_host=True
--send_arp_for_ha=True
--libvirt_type=kvm



透過 dashboard 生成一個 VM 之後, 可以看到他會自動生出來 virtual bridge, ip 是 192.168.128.4

wistor@ubuntu:~$ sudo brctl show
bridge name     bridge id               STP enabled     interfaces
br100           8000.02163e38974d       no              vlan100
                                                        vnet1

wistor@ubuntu:~$ ifconfig br100
br100     Link encap:Ethernet  HWaddr 02:16:3e:38:97:4d
          inet addr:192.168.128.4  Bcast:192.168.128.255  Mask:255.255.255.0
          inet6 addr: fe80::640b:98ff:fe7e:4e8d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:510 (510.0 B)

wistor@ubuntu:~$ virsh list
 Id Name                 State
----------------------------------
  1 instance-00000001    running



也可以透過 virsh edit <id> 看一下 vm 的狀況

<emulator>/usr/bin/kvm </emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/nova/instances/instance-00000002/disk'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <interface type='bridge'>
      <mac address='02:16:3e:42:73:ac'/>
      <source bridge='br100'/>
      <filterref filter='nova-instance-instance-00000002-02163e4273ac'>
        <parameter name='DHCPSERVER' value='192.168.128.4'/>
        <parameter name='IP' value='192.168.128.3'/>
      </filterref>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

在裝了 keystone 之後, 原以為 eucatool 的使用和以前一樣, 是直接和 nova 溝通, 而不需要透過 keystone 認証,
不過在試了很久之後, 也找了相關的文章, 才發現我想的是錯的, 並沒有這樣的路線, 而必須要透過 keystone 認証


沒有裝 keystone 時設定方式
http://docs.openstack.org/diablo/openstack-compute/admin/content/setting-up-openstack-compute-environment-on-the-compute-node.html
http://docs.openstack.org/diablo/openstack-compute/admin/content/creating-certifications.html
http://docs.openstack.org/diablo/openstack-compute/admin/content/managing-compute-users.html

裝了 keystone 時設定方式
http://docs.openstack.org/diablo/openstack-compute/install/content/identity-define-services-endpoints.html
https://answers.launchpad.net/nova/+question/178940


root@ubuntu:~$ apt-get install -y euca2ools unzip
root@ubuntu:~$ mkdir -p creds
root@ubuntu:~$ cd creds

# 這是沒有安裝 keystone 時的方式, 但想要觀察最原始的方式, 他所設定的參數有那些
root@ubuntu:~/creds$ nova-manage user admin novaadmin
export EC2_ACCESS_KEY=38d3466b-79d9-41ad-984c-c44cb65dcf50
export EC2_SECRET_KEY=7c04de4a-083c-47ec-bb39-10bee47c0342
root@ubuntu:~/creds$ nova-manage project create proj novaadmin
root@ubuntu:~/creds$ nova-manage project zipfile proj novaadmin
root@ubuntu:~/creds$ unzip nova.zip
Archive:  nova.zip
 extracting: novarc
 extracting: pk.pem
 extracting: cert.pem
 extracting: cacert.pem
root@ubuntu:~/creds$ cat novarc
NOVARC=$(readlink -f "${BASH_SOURCE:-${0}}" 2>/dev/null) ||
    NOVARC=$(python -c 'import os,sys; print os.path.abspath(os.path.realpath(sys.argv[1]))' "${BASH_SOURCE:-${0}}")
NOVA_KEY_DIR=${NOVARC%/*}
export EC2_ACCESS_KEY="novaadmin:proj"
export EC2_SECRET_KEY="7c04de4a-083c-47ec-bb39-10bee47c0342"
export EC2_URL="http://172.17.123.6:8773/services/Cloud"
export S3_URL="http://172.17.123.6:3333"
export EC2_USER_ID=42 # nova does not use user id, but bundling requires it
export EC2_PRIVATE_KEY=${NOVA_KEY_DIR}/pk.pem
export EC2_CERT=${NOVA_KEY_DIR}/cert.pem
export NOVA_CERT=${NOVA_KEY_DIR}/cacert.pem
export EUCALYPTUS_CERT=${NOVA_CERT} # euca-bundle-image seems to require this set
alias ec2-bundle-image="ec2-bundle-image --cert ${EC2_CERT} --privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}"
alias ec2-upload-bundle="ec2-upload-bundle -a ${EC2_ACCESS_KEY} -s ${EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}"
export NOVA_API_KEY="novaadmin"
export NOVA_USERNAME="novaadmin"
export NOVA_PROJECT_ID="proj"
export NOVA_URL="http://172.17.123.6:8774/v1.1/"
export NOVA_VERSION="1.1"

# 看完了之後就可以砍了, 裡面最重要的是 EC2_ACCESS_KEY, EC2_SECRET_KEY, EC2_URL
root@ubuntu:~/creds$ nova-manage project delete proj
root@ubuntu:~/creds$ nova-manage user delete novaadmin


# 在實驗 EC2 之前, 我先在 keystone 裡面做出另一個帳號, tenant/user 是 demo/demoUser, 並且給他權限
root@ubuntu:~/creds$ keystone-manage tenant add demo
root@ubuntu:~/creds$ keystone-manage user add demouser
root@ubuntu:~/creds$ keystone-manage role grant Admin demoUser demo
root@ubuntu:~/creds$ keystone-manage role grant Member demoUser
root@ubuntu:~/creds$ keystone-manage role grant KeystoneAdmin demoUser
root@ubuntu:~/creds$ keystone-manage role grant KeystoneServiceAdmin demoUser

# 接下來和 keystone 註冊一個 credential 供 EC2 使用
# 指令是 keystone-manage credentials add <user> EC2 <tenant:user> <password> <tenant>
root@ubuntu:~/creds$ keystone-manage credentials add demoUser EC2 demo:demoUser 12345 demo

# 利用 novarc 當範本, 做出另一個
root@ubuntu:~/creds$ cp novarc myrc

# 改掉裡面的 EC2_ACCESS_KEY 和 EC2_SECRET_KEY
root@ubuntu:~/creds$ cat myrc | grep EC2
export EC2_ACCESS_KEY="demo:demoUser"
export EC2_SECRET_KEY="12345"
export EC2_URL="http://172.17.123.6:8773/services/Cloud"
export EC2_USER_ID=42 # nova does not use user id, but bundling requires it
export EC2_PRIVATE_KEY=${NOVA_KEY_DIR}/pk.pem
export EC2_CERT=${NOVA_KEY_DIR}/cert.pem
alias ec2-bundle-image="ec2-bundle-image --cert ${EC2_CERT} --privatekey ${EC2_PRIVATE_KEY} --user 42 --ec2cert ${NOVA_CERT}"
alias ec2-upload-bundle="ec2-upload-bundle -a ${EC2_ACCESS_KEY} -s ${EC2_SECRET_KEY} --url ${S3_URL} --ec2cert ${NOVA_CERT}"

root@ubuntu:~/creds$ source myrc
root@ubuntu:~/creds$ euca-describe-availability-zones verbose
AVAILABILITYZONE        nova    available
AVAILABILITYZONE        |- ubuntu
AVAILABILITYZONE        | |- nova-vncproxy      enabled :-) 2012-04-12 05:32:49
AVAILABILITYZONE        | |- nova-scheduler     enabled :-) 2012-04-12 05:32:48
AVAILABILITYZONE        | |- nova-network       enabled :-) 2012-04-12 05:32:52
AVAILABILITYZONE        | |- nova-compute       enabled :-) 2012-04-12 05:32:48



讓我們偷偷進 database 看一下

mysql> use keystone;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+--------------------+
| Tables_in_keystone |
+--------------------+
| credentials        |
| endpoint_templates |
| endpoints          |
| roles              |
| services           |
| tenants            |
| token              |
| user_roles         |
| users              |
+--------------------+
9 rows in set (0.00 sec)

mysql> select id,name,tenant_id from users;
+----+----------+-----------+
| id | name     | tenant_id |
+----+----------+-----------+
|  1 | admin    |      NULL |
|  2 | demoUser |      NULL |
+----+----------+-----------+

mysql> select * from roles;
+----+----------------------+------+------------+
| id | name                 | desc | service_id |
+----+----------------------+------+------------+
|  1 | Admin                | NULL |       NULL |
|  2 | Member               | NULL |       NULL |
|  3 | KeystoneAdmin        | NULL |       NULL |
|  4 | KeystoneServiceAdmin | NULL |       NULL |
+----+----------------------+------+------------+

mysql> select * from tenants;
+----+-------+------+---------+
| id | name  | desc | enabled |
+----+-------+------+---------+
|  1 | admin | NULL |       1 |
|  2 | demo  | NULL |       1 |
+----+-------+------+---------+

mysql> select * from services;
+----+----------+----------+---------------------------+
| id | name     | type     | desc                      |
+----+----------+----------+---------------------------+
|  1 | nova     | compute  | Nova Compute Service      |
|  2 | glance   | image    | Glance Image Service      |
|  3 | keystone | identity | Keystone Identity Service |
+----+----------+----------+---------------------------+

mysql> select * from credentials;
+----+---------+-----------+------+---------------+---------+
| id | user_id | tenant_id | type | key           | secret  |
+----+---------+-----------+------+---------------+---------+
|  1 |       1 |         1 | EC2  | admin:admin   | letmein |
|  2 |       2 |         2 | EC2  | demo:demoUser | 12345   |
+----+---------+-----------+------+---------------+---------+


我們在 database 中看到 EC2 使用的認証資料, 而且其實原本的 script 就有幫我們建好一組供 EC2 使用了
所以我們其實只要把 EC2_ACCESS_KEY(admin:admin), EC2_SECRET_KEY(letmein), EC2_URL 設定好就可以使用了


相關文章:
http://wikitech.wikimedia.org/view/OpenStack#On_all_nova_nodes.2C_install_the_nova_PPA
http://docs.openstack.org/diablo/openstack-compute/admin/content/reference-for-flags-in-nova-conf.html


補: 紀錄一下 nova-manage config list
--storage_availability_zone=nova
--vc_image_name=vc_image
--ec2_dmz_host=$my_ip
--fixed_range=192.168.128.0/17
--compute_topic=compute
--vsa_topic=vsa
--dmz_mask=255.255.0.0
--fixed_range_v6=fd00::/48
--glance_api_servers=172.17.123.81:9292
--rabbit_password=guest
--user_cert_subject=/C=US/ST=California/L=MountainView/O=AnsoLabs/OU=NovaDev/CN=%s-%s-%s
--s3_dmz=172.17.123.81
--quota_ram=51200
--find_host_timeout=30
--aws_access_key_id=admin
--vncserver_host=0.0.0.0
--network_size=256
--virt_mkfs=windows=mkfs.ntfs --fast --label %(fs_label)s %(target)s --virt_mkfs=linux=mkfs.ext3 -L %(fs_label)s -F %(tar
get)s --virt_mkfs=default=mkfs.ext3 -L %(fs_label)s -F %(target)s
--enable_new_services
--my_ip=172.17.123.81
--live_migration_retry_count=30
--lockout_attempts=5
--credential_cert_file=cert.pem
--quota_max_injected_files=5
--zone_capabilities=hypervisor=xenserver;kvm,os=linux;windows
--logdir=/var/log/nova
--sqlite_db=nova.sqlite
--nouse_forwarded_for
--cpuinfo_xml_template=/usr/lib/python2.7/dist-packages/nova/virt/cpuinfo.xml.template
--num_networks=1
--boot_script_template=/usr/lib/python2.7/dist-packages/nova/cloudpipe/bootscript.template
--vsa_manager=nova.vsa.manager.VsaManager
--live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER
--notification_driver=nova.notifier.no_op_notifier
--osapi_max_limit=1000
--vsa_multi_vol_creation
--rabbit_port=5672
--s3_access_key=notchecked
--rabbit_max_retries=0
--noresume_guests_state_on_host_boot
--ajax_console_proxy_url=http://172.17.123.81:8000
--injected_network_template=/usr/lib/python2.7/dist-packages/nova/virt/interfaces.template
--snapshot_name_template=snapshot-%08x
--vncproxy_url=http://172.17.123.81:6080
--osapi_port=8774
--ajax_console_proxy_topic=ajax_proxy
--minimum_root_size=10737418240
--quota_cores=20
--nouse_project_ca
--vsa_name_template=vsa-%08x
--default_log_levels=amqplib=WARN,sqlalchemy=WARN,boto=WARN,eventlet.wsgi.server=WARN
--volume_topic=volume
--nolibvirt_use_virtio_for_bridges
--volume_name_template=volume-%08x
--lock_path=/var/lock/nova
--live_migration_uri=qemu+tcp://%s/system
--allow_same_net_traffic
--flat_network_dns=8.8.4.4
--default_vsa_instance_type=m1.small
--live_migration_bandwidth=0
--connection_type=libvirt
--noupdate_dhcp_on_disassociate
--default_project=openstack
--s3_port=3333
--logfile_mode=0644
--logging_context_format_string=%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s] %(message)s
--s3_secret_key=notchecked
--instance_name_template=instance-%08x
--ec2_host=172.17.123.81
--norabbit_durable_queues
--credential_key_file=pk.pem
--vpn_cert_subject=/C=US/ST=California/L=MountainView/O=AnsoLabs/OU=NovaDev/CN=project-vpn-%s-%s
--logging_debug_format_suffix=from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
--network_host=wistor
--console_manager=nova.console.manager.ConsoleProxyManager
--rpc_backend=nova.rpc.impl_kombu
--rabbit_userid=guest
--osapi_scheme=http
--credential_rc_file=%src
--dhcp_domain=novalocal
--sql_connection=mysql://nova:letmeinN@0.0.0.0/nova
--console_topic=console
--instances_path=$state_path/instances
--noflat_injected
--use_local_volumes
--host=wistor
--fixed_ip_disassociate_timeout=600
--quota_instances=10
--quota_max_injected_file_content_bytes=10240
--libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtBridgeDriver
--floating_range=4.4.4.0/24
--multi_host
--lockout_window=15
--db_backend=sqlalchemy
--credentials_template=/usr/lib/python2.7/dist-packages/nova/auth/novarc.template
--dmz_net=192.168.128.0
--sql_retry_interval=10
--vpn_start=1000
--volume_driver=nova.volume.driver.ISCSIDriver
--crl_file=crl.pem
--nomonkey_patch
--rpc_conn_pool_size=30
--s3_host=172.17.123.81
--vlan_interface=eth1
--novolume_force_update_capabilities
--scheduler_topic=scheduler
--verbose
--sql_max_retries=12
--default_instance_type=m1.small
--vsa_volume_type_name=VSA volume type
--firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
--password_length=12
--console_host=wistor
--libvirt_type=kvm
--image_decryption_dir=/tmp
--vpn_key_suffix=-vpn
--use_cow_images
--block_size=268435456
--null_kernel=nokernel
--libvirt_xml_template=/usr/lib/python2.7/dist-packages/nova/virt/libvirt.xml.template
--vpn_client_template=/usr/lib/python2.7/dist-packages/nova/cloudpipe/client.ovpn.template
--credential_vpn_file=nova-vpn.conf
--service_down_time=60
--default_notification_level=INFO
--nopublish_errors
--quota_metadata_items=128
--allowed_roles=cloudadmin,itsec,sysadmin,netadmin,developer
--logging_exception_prefix=(%(name)s): TRACE:
--enabled_apis=ec2,osapi
--quota_max_injected_file_path_bytes=255
--scheduler_manager=nova.scheduler.manager.SchedulerManager
--ec2_port=8773
--monkey_patch_modules=nova.api.ec2.cloud:nova.notifier.api.notify_decorator,nova.compute.api:nova.notifier.api.notify_decorator
--rabbit_retry_backoff=2
--auth_token_ttl=3600
--quota_volumes=10
--libvirt_uri=
--ec2_scheme=http
--keys_path=$state_path/keys
--vpn_image_id=0
--host_state_interval=120
--block_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_NON_SHARED_INC
--noauto_assign_floating_ip
--ca_file=cacert.pem
--quota_floating_ips=10
--max_vcs_in_vsa=32
--nofake_call
--default_publisher_id=wistor
--state_path=/var/lib/nova
--max_nbd_devices=16
--sql_idle_timeout=3600
--vpn_ip=$my_ip
--default_image=ami-11111
--aws_secret_access_key=admin
--nouse_ipv6
--stub_network=False
--key_file=private/cakey.pem
--nofake_network
--force_dhcp_release
--osapi_extensions_path=/var/lib/nova/extensions
--quota_gigabytes=1000
--region_list=
--auth_driver=nova.auth.dbdriver.DbDriver
--network_manager=nova.network.manager.VlanManager
--enable_zone_routing
--root_helper=sudo
--osapi_host=172.17.123.81
--zone_name=nova
--logging_default_format_string=%(asctime)s %(levelname)s %(name)s [-] %(message)s
--timeout_nbd=10
--compute_driver=nova.virt.connection.get_connection
--libvirt_vif_type=bridge
--nofake_rabbit
--rabbit_host=172.17.123.81
--vnc_keymap=en-us
--rescue_timeout=0
--ca_path=$state_path/CA
--nouse_syslog
--superuser_roles=cloudadmin
--osapi_path=/v1.1/
--nouse_deprecated_auth
--ec2_path=/services/Cloud
--norabbit_use_ssl
--rabbit_retry_interval=1
--node_availability_zone=nova
--lockout_minutes=15
--db_driver=nova.db.api
--create_unique_mac_address_attempts=5
--ajaxterm_portrange=10000-12000
--volume_manager=nova.volume.manager.VolumeManager
--nostart_guests_on_host_boot
--vlan_start=100
--rpc_thread_pool_size=1024
--ipv6_backend=rfc2462
--vnc_enabled
--global_roles=cloudadmin,itsec
--rabbit_virtual_host=/
--network_driver=nova.network.linux_net
--ajax_console_proxy_port=8000
--project_cert_subject=/C=US/ST=California/L=MountainView/O=AnsoLabs/OU=NovaDev/CN=project-ca-%s-%s
--image_service=nova.image.glance.GlanceImageService
--control_exchange=nova
--cnt_vpn_clients=0
--vsa_part_size_gb=100
--vncproxy_topic=vncproxy
--compute_manager=nova.compute.manager.ComputeManager
--network_topic=network