Views:

The DPX virtual appliance ships with three virtual disks. This document describes how to add a new (fourth) virtual disk (hard disk) on your DPX virtual machine to expand the /catalogic mount point

Step By Step

The DPX virtual appliance ships with three virtual disks. This document describes how to add a new virtual disk (hard disk) on your DPX virtual machine. By default, when you deploy the DPX virtual appliance you have the option to only deploy all three virtual disks to one datastore that you specify at the time of deployment.

These instructions will guide you through adding a new disk within the virtual machine and to configure it as an LVM. You can then mount it as a new volume or attach this new disk to the existing /catalogic volume within the virtual appliance. For example, if you are adding the fourth disk, you will see a disk device called /dev/sdd within the virtual machine.

After you deploy the DPX virtual appliance, below are the lists of disks and partitions on the DPX virtual machine. /dev/mapper/dpx-dpxlv is the LVM disk for the /catalogic mount point.

In order to run the commands below, you need to SSH into the DPX appliance’s command prompt as the dpxadmin account. The default initial password is “DPXvStor” and you will be prompted to change the password at the first login.

Review the disk partitions using the fdisk -l command:

[dpxadmin@dpx455 ~]$ sudo fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Disk /dev/sdc: 107.4 GB, 107374182400 bytes, 209715200 sectors

Review the physical volumes and the volume groups on the DPX virtual appliance using the pvdisplay and vgdisplay commands respectively.

[dpxadmin@dpx455 ~]$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdc
  VG Name               dpx
  PV Size               100.00 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              25599
  Free PE               3839
  Allocated PE          21760
  PV UUID               fTJW1j-uUzG-21S2-h44A-7J5f-zJTf-1zfP8U

  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               centos
  PV Size               <49.00 GiB / not usable 3.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              12543
  Free PE               1535
  Allocated PE          11008
  PV UUID               J3Y03i-IFBK-5ror-0w0H-g9fq-y9md-7S7dnL
[dpxadmin@dpx455 ~]$ sudo vgdisplay
  --- Volume group ---
  VG Name               dpx
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <100.00 GiB
  PE Size               4.00 MiB
  Total PE              25599
  Alloc PE / Size       21760 / 85.00 GiB
  Free  PE / Size       3839 / <15.00 GiB
  VG UUID               oKpInM-aG1w-rr8b-HyeA-cXMz-hUfQ-o2FDdh

  --- Volume group ---
  VG Name               centos
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <49.00 GiB
  PE Size               4.00 MiB
  Total PE              12543
  Alloc PE / Size       11008 / 43.00 GiB
  Free  PE / Size       1535 / <6.00 GiB
  VG UUID               OmBgrS-7YQa-xxmC-5c0u-xZNB-K9Sv-7YQFCK

You can see that the allocated PE for the dpx volume group is 85 GB and there is not much PE to allocate further.

Add a Disk to the VM

  1. Edit the settings of the VM.

  2. On the Hardware tab, click Add….

  3. Select the option Create a new virtual disk.

  4. Select the required Disk Size. Then in the “Location” section either “Store with the virtual machine” or “Specfiy a datastore or datatore cluster".

    Select Store with the virtual machine: to use the current datastore.

    Or, select Specfiy a datastore or datatore cluster: and click Browse… to select the new datastore where you want your new virtual disk to reside.

  5. Leave the default values in the “Advanced Options” tab.

  6. Review and save your changes.

  7. Click Edit settings for the virtual machine. You can see your new hard disk.

  8. Reboot the Virtual Appliance or use sudo partprobe to make the new disk accessible

You can now see the fourth disk: /dev/sdd.

Disk Expansion Procedure

This section will guide you through adding storage capacity from the new disk to an existing DPX volume. For users that are simply adding an additional volume to their appliance, this section does not need to be completed. First you need to setup the filesystem for the new disk, /dev/sdd to be LVM type.

  1. Create new LVM Partition on added Disk

    The commands set up a partition for /dev/sdd and set the partition to be of type Linux LVM. The output of fdisk in the end shows you the same.

    [dpxadmin@dpx455 ~]$ sudo fdisk /dev/sdd
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0xdea82083.
    
    Command (m for help): m
    Command action
       a   toggle a bootable flag
       b   edit bsd disklabel
       c   toggle the dos compatibility flag
       d   delete a partition
       g   create a new empty GPT partition table
       G   create an IRIX (SGI) partition table
       l   list known partition types
       m   print this menu
       n   add a new partition
       o   create a new empty DOS partition table
       p   print the partition table
       q   quit without saving changes
       s   create a new empty Sun disklabel
       t   change a partition's system id
       u   change display/entry units
       v   verify the partition table
       w   write table to disk and exit
       x   extra functionality (experts only)
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector (2048-41943039, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 
    Using default value 41943039
    Partition 1 of type Linux and of size 20 GiB is set
    
    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): 8e
    Changed type of partition 'Linux' to 'Linux LVM'
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
  2. Review the changes to the disk:

    [dpxadmin@dpx455 ~]$ sudo fdisk -l
    
    Disk /dev/sdd: 21.5 GB, 21474836480 bytes, 41943040 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0xdea82083
    
    Device Boot      Start         End      Blocks   Id  System
    /dev/sdd1            2048    41943039    20970496   8e  Linux LVM
  3. Review the current list of Physical Volumes (PV):

    [dpxadmin@dpx455 ~]$ sudo pvdisplay
      --- Physical volume ---
      PV Name               /dev/sdc
      VG Name               dpx
      PV Size               100.00 GiB / not usable 4.00 MiB
      Allocatable           yes
      PE Size               4.00 MiB
      Total PE              25599
      Free PE               3839
      Allocated PE          21760
      PV UUID               fTJW1j-uUzG-21S2-h44A-7J5f-zJTf-1zfP8U
    
      --- Physical volume ---
      PV Name               /dev/sda2
      VG Name               centos
      PV Size               <49.00 GiB / not usable 3.00 MiB
      Allocatable           yes
      PE Size               4.00 MiB
      Total PE              12543
      Free PE               1535
      Allocated PE          11008
      PV UUID               J3Y03i-IFBK-5ror-0w0H-g9fq-y9md-7S7dnL
  4. Create a new Physical Volume (PV):

    [dpxadmin@dpx455 ~]$ sudo pvcreate /dev/sdd1
    Physical volume "/dev/sdd1" successfully created.
  5. You can now see the new PV created from /dev/sdd1.

  6. [dpxadmin@dpx455 ~]$ sudo pvdisplay
     "/dev/sdd1" is a new physical volume of "<20.00 GiB"
      --- NEW Physical volume ---
      PV Name               /dev/sdd1
      VG Name
      PV Size               <20.00 GiB
      Allocatable           NO
      PE Size               0
      Total PE              0
      Free PE               0
      Allocated PE          0
      PV UUID               lqEJfa-M4rT-gK5g-X21n-jzEL-Oin0-QnVLLc
  7. Review the Volume Group (VG).

  8. [dpxadmin@dpx455 ~]$ sudo vgdisplay
      --- Volume group ---
      VG Name               dpx
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  2
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               1
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               <100.00 GiB
      PE Size               4.00 MiB
      Total PE              25599
      Alloc PE / Size       21760 / 85.00 GiB
      Free  PE / Size       3839 / <15.00 GiB
      VG UUID               oKpInM-aG1w-rr8b-HyeA-cXMz-hUfQ-o2FDdh
    
      --- Volume group ---
      VG Name               centos
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               <49.00 GiB
      PE Size               4.00 MiB
      Total PE              12543
      Alloc PE / Size       11008 / 43.00 GiB
      Free  PE / Size       1535 / <6.00 GiB
      VG UUID               OmBgrS-7YQa-xxmC-5c0u-xZNB-K9Sv-7YQFCK
  9. Add the new Physical Volume (PV) to the Volume Group (VG) to increase its space:

    [dpxadmin@dpx455 ~]$ sudo vgextend dpx /dev/sdd1
      Volume group "dpx" successfully extended
  10. You can see that after the Volume Group (VG) dpx is extended, there is free space available for logical volumes (or /catalogic volume) to use.

    [dpxadmin@dpx455 ~]$ sudo vgdisplay
      --- Volume group ---
      VG Name               dpx
      System ID
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               1
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               119.99 GiB
      PE Size               4.00 MiB
      Total PE              30718
      Alloc PE / Size       21760 / 85.00 GiB
      Free  PE / Size       8958 / 34.99 GiB
      VG UUID               oKpInM-aG1w-rr8b-HyeA-cXMz-hUfQ-o2FDdh
  11. Review the Logical Volume (DPXLV) /catalogic.

    [dpxadmin@dpx455 ~]$ sudo lvdisplay
      --- Logical volume ---
      LV Path                /dev/dpx/dpxlv
      LV Name                dpxlv
      VG Name                dpx
      LV UUID                LOiZ9s-srPo-f9rD-74Xo-stj7-M23U-X9Bbv4
      LV Write Access        read/write
      LV Creation host, time localhost.localdomain, 2019-08-19 21:48:22 +0000
      LV Status              available
      # open                 1
      LV Size                85.00 GiB
      Current LE             21760
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     8192
      Block device           253:2

    The /catalogic mount point currently has a total size of 84GB

    [dpxadmin@dpx455 ~]$ df -h
    Filesystem                 Size  Used Avail Use% Mounted on
    ...
    devtmpfs                   7.8G     0  7.8G   0% /dev
    ...
    /dev/sda1                  976M  112M  798M  13% /boot
    /dev/mapper/dpx-dpxlv       84G  1.6G   78G   2% /catalogic
    vpool1                      97G  128K   97G   1% /vstor/vpool1
    ...
    tmpfs                      1.6G     0  1.6G   0% /run/user/0
  12. Add space to the Logical Volume (LV) /dpx-dpxlv

    Use the lvextend command by adding the additional space to the total volume capacity. Be sure to reduce the amount of space added by 1GB.

    In this example we are adding 20GB of space to the volume. First we reduce the amount of space we are adding by 1GB, then we add it to the overall volume capacity, it should read 103GB:

    [dpxadmin@dpx455 ~]$ sudo lvextend -L 103G -r /dev/dpx/dpxlv
    
      Size of logical volume dpx/dpxlv changed from 85.00 GiB (21760 extents) to 103
    ↪.00 GiB (26368 extents).
      Logical volume dpx/dpxlv successfully resized.
    resize2fs 1.42.9 (28-Dec-2013)
    
    Filesystem at /dev/mapper/dpx-dpxlv is mounted on /catalogic; on-line resizing r
    ↪equired
    old_desc_blocks = 11, new_desc_blocks = 13
    The filesystem on /dev/mapper/dpx-dpxlv is now 27000832 blocks long.
  13. After running the above, the size of the /catalogic volume will display as the newly expanded size.

    [dpxadmin@dpx455 ~]$ sudo lvdisplay
      --- Logical volume ---
      LV Path                /dev/dpx/dpxlv
      LV Name                dpxlv
      VG Name                dpx
      LV UUID                LOiZ9s-srPo-f9rD-74Xo-stj7-M23U-X9Bbv4
      LV Write Access        read/write
      LV Creation host, time localhost.localdomain, 2019-08-19 21:48:22 +0000
      LV Status              available
      # open                 1
      LV Size                103.00 GiB
      Current LE             26368
      Segments               2
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     8192
      Block device           253:2
    [dpxadmin@dpx455 ~]$ df -h
    Filesystem                 Size  Used Avail Use% Mounted on
    ...
    devtmpfs                   7.8G     0  7.8G   0% /dev
    ...
    /dev/sda1                  976M  112M  798M  13% /boot
    /dev/mapper/dpx-dpxlv      102G  1.6G   95G   2% /catalogic
    ...
    tmpfs                      1.6G     0  1.6G   0% /run/user/0
Comments (0)