统一计算 : Cisco UCS Performance Manager

增加VM磁盘的大小UCSPM的

2016 年 10 月 24 日 - 机器翻译
其他版本: PDFpdf | 英语 (2016 年 4 月 21 日) | 反馈

简介

本文描述如何增加大小磁盘在运行一UCS Performance Manager的基础虚拟机(UCSPM) VMware ESXi主机的。

贡献用托马什Stala, Cisco TAC工程师。

问题

有时,当UCSPM的根分区变得全双工时,系统不正常运行。一个原因是日志文件由应用程序创建变得太大。

解决方案

在您开始前,您必须首先关闭UCSMPM虚拟机。然后请连接对与安全壳SSH的ESXi主机CLI并且寻找在数据存储器的vmdk文件。

  1. 为了对一个新的指定的长度扩大在当前虚拟机磁盘文件的空间,请输入vmkfstools at命令ESXi主机。
    /vmfs/volumes/datastore/ucspm11.cisco.lab # vmkfstools 
    --extendvirtualdisk 200G ucspm11.cisco.lab.vmdk
    Grow: 100% done.
  2. 用这些命令检查当前文件系统状态:
    [root@localhost ~]# df -h
    Filesystem                    Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup-lv_root   78G  3.6G   71G   5% /
    tmpfs                         7.8G   56K  7.8G   1% /dev/shm
    /dev/sda1                     485M   32M  428M   7% /boot
    /dev/mapper/VolGroup-lv_home   22G  314M   20G   2% /home
    [root@localhost ~]# fdisk -l /dev/sda

    Disk /dev/sda: 214.7 GB, 214748364800 bytes
    255 heads, 63 sectors/track, 26108 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0007c854

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          64      512000   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2              64       13055   104344576   8e  Linux LVM
  3. 磁盘已经有大容量然而新空间需要分配。创建新的主要的分区。为了执行此任务请输入这五命令:
    • p -显示当前分区状态
    • n -创建一个新的分区
    • p -创建一个主要的分区
    • 3 -分区编号
    • w -写入对磁盘的更改
    [root@localhost ~]# fdisk /dev/sda

    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c') and change display units to
             sectors (command 'u').

    Command (m for help): p

    Disk /dev/sda: 214.7 GB, 214748364800 bytes
    255 heads, 63 sectors/track, 26108 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0007c854

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          64      512000   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2              64       13055   104344576   8e  Linux LVM

    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)

    p


    Partition number (1-4): 3
    First cylinder (13055-26108, default 13055):
    Using default value 13055
    Last cylinder, +cylinders or +size{K,M,G} (13055-26108, default 26108):
    Using default value 26108

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.

    WARNING: Re-reading the partition table failed with error 16:
    Device or resource busy.
    The kernel still uses the old table. The new table will be used at
    the next reboot or after you run partprobe(8) or kpartx(8)
    Syncing disks.
  4. 系统重新启动要求为了应用在分区表上的变化。
    [root@localhost ~]# shutdown -r now
  5. 输入fdisk命令为了验证新的分区顺利地创建。
    [root@localhost ~]# fdisk -l /dev/sda

    Disk /dev/sda: 214.7 GB, 214748364800 bytes
    255 heads, 63 sectors/track, 26108 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0007c854

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          64      512000   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2              64       13055   104344576   8e  Linux LVM
    /dev/sda3           13055       26108   104854910   83  Linux
  6. 由创建的分区最近扩大当前卷组(VolGroup)。
    [root@localhost ~]# vgextend VolGroup /dev/sda3
      Volume group "VolGroup" successfully extended

    vgdisplay命令显示关于卷组、总大小和自由物理范围(PE)单元的详细信息。

    [root@localhost ~]# vgdisplay
      --- Volume group ---
      VG Name               VolGroup
      System ID
      Format                lvm2
      Metadata Areas        3
      Metadata Sequence No  13
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                3
      Open LV               3
      Max PV                0
      Cur PV                3
      Act PV                3
      VG Size               209.50 GiB
      PE Size               4.00 MiB
      Total PE              53632
      Alloc PE / Size       27833 / 108.72 GiB
      Free  PE / Size       25799 / 100.78 GiB
      VG UUID               TIm13O-WNDC-O4jC-wA4q-dnbN-hVxp-iZnwzC
  7. 扩大装载作为根分区的逻辑音量(/dev/mapper/VolGroup-lv_root)。- l参数指定自由物理范围单元的范围。

    在本例中,分配PE/大小值从前面的命令是25799。请勿忘掉+此处符号您能否则毁坏系统。

    [root@localhost ~]# lvextend -l +25799 /dev/mapper/VolGroup-lv_root
      Extending logical volume lv_root to 179.99 GiB
      Logical volume lv_root successfully resized
  8. 输入这些命令为了验证当前逻辑音量大小和属性卷组的为了发现相关的物理磁盘:
    [root@localhost ~]# lvdisplay /dev/mapper/VolGroup-lv_root
      --- Logical volume ---
      LV Path                /dev/VolGroup/lv_root
      LV Name                lv_root
      VG Name                VolGroup
      LV UUID                0cQmLZ-LnBN-5R8B-1LfQ-0F9n-jeIr-S4WGWg
      LV Write Access        read/write
      LV Creation host, time localhost.localdomain, 2015-03-18 11:39:05 +0000
      LV Status              available
      # open                 1
      LV Size                179.99 GiB
      Current LE             46078
      Segments               4
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:0
    [root@localhost ~]# vgdisplay -v VolGroup
        Using volume group(s) on command line
        Finding volume group "VolGroup"
      --- Volume group ---
      VG Name               VolGroup
      System ID
      Format                lvm2
      Metadata Areas        3
      Metadata Sequence No  14
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                3
      Open LV               3
      Max PV                0
      Cur PV                3
      Act PV                3
      VG Size               209.50 GiB
      PE Size               4.00 MiB
      Total PE              53632
      Alloc PE / Size       53632 / 209.50 GiB
      Free  PE / Size       0 / 0
      VG UUID               TIm13O-WNDC-O4jC-wA4q-dnbN-hVxp-iZnwzC

      --- Logical volume ---
      LV Path                /dev/VolGroup/lv_root
      LV Name                lv_root
      VG Name                VolGroup
      LV UUID                0cQmLZ-LnBN-5R8B-1LfQ-0F9n-jeIr-S4WGWg
      LV Write Access        read/write
      LV Creation host, time localhost.localdomain, 2015-03-18 11:39:05 +0000
      LV Status              available
      # open                 1
      LV Size                179.99 GiB
      Current LE             46078
      Segments               4
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:0

      --- Logical volume ---
      LV Path                /dev/VolGroup/lv_home
      LV Name                lv_home
      VG Name                VolGroup
      LV UUID                nMhmiO-1f50-htLI-0YBI-NtfE-JLmt-slzTpJ
      LV Write Access        read/write
      LV Creation host, time localhost.localdomain, 2015-03-18 11:39:12 +0000
      LV Status              available
      # open                 1
      LV Size                21.65 GiB
      Current LE             5542
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:2

      --- Logical volume ---
      LV Path                /dev/VolGroup/lv_swap
      LV Name                lv_swap
      VG Name                VolGroup
      LV UUID                E6UQB1-8eqg-o2rS-zg1k-Op4V-lnmu-HU1jrI
      LV Write Access        read/write
      LV Creation host, time localhost.localdomain, 2015-03-18 11:39:18 +0000
      LV Status              available
      # open                 1
      LV Size                7.86 GiB
      Current LE             2012
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:1

      --- Physical volumes ---
      PV Name               /dev/sda2
      PV UUID               3eUCnc-uvaz-1u4R-uumD-dRnY-JPsH-hxPARW
      PV Status             allocatable
      Total PE / Free PE    25474 / 0

      PV Name               /dev/sdb
      PV UUID               2kcp3I-FL9y-dL6n-y1ex-DcDH-Zx1l-Tfxl3z
      PV Status             allocatable
      Total PE / Free PE    2559 / 0

      PV Name               /dev/sda3
      PV UUID               Utzlpq-QnVa-lWfl-V20Z-d5eN-JSiz-btHmZN
      PV Status             allocatable
      Total PE / Free PE    25599 / 0
     
  9. 在逻辑音量增加后,请通过新的逻辑音量大小放大根文件系统。
    [root@localhost ~]# resize2fs /dev/mapper/VolGroup-lv_root
    resize2fs 1.41.12 (17-May-2010)
    Filesystem at /dev/mapper/VolGroup-lv_root is mounted on /; on-line resizing required
    old desc_blocks = 5, new_desc_blocks = 12
    Performing an on-line resize of /dev/mapper/VolGroup-lv_root to 47183872 (4k) blocks.
    The filesystem on /dev/mapper/VolGroup-lv_root is now 47183872 blocks long.

    文件系统磁盘空间使用情况应该当前显示一个新的延长的大小。

    [root@localhost ~]# df -h
    Filesystem                    Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup-lv_root  178G  3.6G  165G   3% /
    tmpfs                         7.8G   56K  7.8G   1% /dev/shm
    /dev/sda1                     485M   32M  428M   7% /boot
    /dev/mapper/VolGroup-lv_home   22G  314M   20G   2% /home


Document ID: 119039