2016年3月22日火曜日

virt-cloneコマンド実行後、空き領域が足りないエラーが出たのでディスク増設実施

ゲストOSのクローン作成をするも空き領域が足りない。
# virt-clone -o www -n www2 -f /var/kvm/images/www2.img

ERROR    ディスクを作成するための十分な空き領域がありません。 30720 MBの要求 > 13898 MBの空き

サーバーシャットダウン後、物理ディスク(2TB)を追加して起動。
以下のサイトを参考にして/extdisk1に1.7T追加されるようになった。
http://kajuhome.com/disk_extension.shtml

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos6-lv_root
                       50G   43G  4.3G  91% /
tmpfs                 2.9G   84K  2.9G   1% /dev/shm
/dev/sda1             477M  142M  310M  32% /boot
/dev/mapper/vg_centos6-lv_home
                      174G   61M  165G   1% /home
/dev/sdb1             1.8T  196M  1.7T   1% /extdisk1 /***/extdisk1を作成してmountコマンド実施済***/

その後virt-clone を実行するも変わらず。
たぶん
/dev/mapper/vg_centos6-lv_root
の領域を増やす必要があると予測。
http://j-caw.co.jp/blog/?p=991
を参考に
/dev/mapper/vg_centos6-lv_root
の領域をふやしてみた。
以下実行手順

# umount /dev/sdb1 ***df -hで/dev/sdb1を/extdisk1からはずす**/

# df -h /***/dev/sdb1が表示されないことを確認***/
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos6-lv_root
                       50G   43G  4.3G  91% /
tmpfs                 2.9G   84K  2.9G   1% /dev/shm
/dev/sda1             477M  142M  310M  32% /boot
/dev/mapper/vg_centos6-lv_home
                      174G   61M  165G   1% /home
# pvcreate /dev/sdb1 /***物理ディスク作成***/
  Physical volume "/dev/sdb1" successfully created

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_centos6
  PV Size               232.40 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              59493
  Free PE               0
  Allocated PE          59493
  PV UUID               4y7MhE-FqgU-sNBF-fRca-E2cR-mm72-jpkc4Q
  "/dev/sdb1" is a new physical volume of "1.82 TiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb1
  VG Name
  PV Size               1.82 TiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               SdhrPT-uhoB-scAS-0vdG-BOnD-S27d-AibzTf
# vgdisplay
  --- Volume group ---
  VG Name               vg_centos6
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               232.39 GiB
  PE Size               4.00 MiB
  Total PE              59493
  Alloc PE / Size       59493 / 232.39 GiB
  Free  PE / Size       0 / 0
  VG UUID               l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q
# lvdisplay /dev/mapper/vg_centos6-lv_root /***LV Sizeは50GB***/
  --- Logical volume ---
  LV Path                /dev/vg_centos6/lv_root
  LV Name                lv_root
  VG Name                vg_centos6
  LV UUID                0GHTft-n48J-prcX-hV1O-fZ1R-ZlL2-dvdAWG
  LV Write Access        read/write
  LV Creation host, time centos6, 2015-12-05 22:27:49 +0900
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

# vgdisplay
  --- Volume group ---
  VG Name               vg_centos6
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               232.39 GiB
  PE Size               4.00 MiB
  Total PE              59493
  Alloc PE / Size       59493 / 232.39 GiB
  Free  PE / Size       0 / 0
  VG UUID               l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q

# pvdisplay /***既存のVG Nameと新規作成のPV Nameを確認***/
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_centos6
  PV Size               232.40 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              59493
  Free PE               0
  Allocated PE          59493
  PV UUID               4y7MhE-FqgU-sNBF-fRca-E2cR-mm72-jpkc4Q
  "/dev/sdb1" is a new physical volume of "1.82 TiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb1
  VG Name
  PV Size               1.82 TiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               SdhrPT-uhoB-scAS-0vdG-BOnD-S27d-AibzTf
# vgextend vg_centos6 /dev/sdb1 /***ボリュームグループを拡張***/
  Volume group "vg_centos6" successfully extended
# vgdisplay /***Free  PE / Sizeが増えている***/
  --- Volume group ---
  VG Name               vg_centos6
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               2.05 TiB
  PE Size               4.00 MiB
  Total PE              536424
  Alloc PE / Size       59493 / 232.39 GiB
  Free  PE / Size       476931 / 1.82 TiB
  VG UUID               l7l1Qm-1a6k-aLuo-f6as-Ad9W-fKUb-rlSp0Q
# lvextend -L+10G /dev/mapper/vg_centos6-lv_root /***10G拡張する***/
(参考 https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lv_extend.html
  Size of logical volume vg_centos6/lv_root changed from 50.00 GiB (12800 extents) to 60.00 GiB (15360 extents).
  Logical volume lv_root successfully resized
# lvdisplay /***LV Sizeが10G増えて60となっている***/
  --- Logical volume ---
  LV Path                /dev/vg_centos6/lv_root
  LV Name                lv_root
  VG Name                vg_centos6
  LV UUID                0GHTft-n48J-prcX-hV1O-fZ1R-ZlL2-dvdAWG
  LV Write Access        read/write
  LV Creation host, time centos6, 2015-12-05 22:27:49 +0900
  LV Status              available
  # open                 1
  LV Size                60.00 GiB
  Current LE             15360
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
  --- Logical volume ---
  LV Path                /dev/vg_centos6/lv_home
  LV Name                lv_home
  VG Name                vg_centos6
  LV UUID                F6FT0Y-TKse-zeMy-dEwc-JBMW-66fG-x9GxGW
  LV Write Access        read/write
  LV Creation host, time centos6, 2015-12-05 22:28:16 +0900
  LV Status              available
  # open                 1
  LV Size                176.58 GiB
  Current LE             45205
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2
  --- Logical volume ---
  LV Path                /dev/vg_centos6/lv_swap
  LV Name                lv_swap
  VG Name                vg_centos6
  LV UUID                9OSVwv-wmEa-CYcA-aYn0-q3Br-0CmH-tUliqW
  LV Write Access        read/write
  LV Creation host, time centos6, 2015-12-05 22:29:42 +0900
  LV Status              available
  # open                 1
  LV Size                5.81 GiB
  Current LE             1488
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
# df -h /***/dev/mapper/vg_centos6-lv_rootは50Gのままで増えていない***/
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos6-lv_root
                       50G   43G  4.3G  91% /
tmpfs                 2.9G   80K  2.9G   1% /dev/shm
/dev/sda1             477M  142M  310M  32% /boot
/dev/mapper/vg_centos6-lv_home
                      174G   61M  165G   1% /home
# resize2fs /dev/mapper/vg_centos6-lv_root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_centos6-lv_root is mounted on /; on-line resizing required
old desc_blocks = 4, new_desc_blocks = 4
Performing an on-line resize of /dev/mapper/vg_centos6-lv_root to 15728640 (4k) blocks.
The filesystem on /dev/mapper/vg_centos6-lv_root is now 15728640 blocks long.
# df -h /***resize2fs実行後は/dev/mapper/vg_centos6-lv_rootは59Gと約10G増えている***/
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos6-lv_root
                       59G   43G   14G  76% /
tmpfs                 2.9G   80K  2.9G   1% /dev/shm
/dev/sda1             477M  142M  310M  32% /boot
/dev/mapper/vg_centos6-lv_home
                      174G   61M  165G   1% /home

空き領域が増えたところで、再度virt-cloneを実行。
でも、状況変わらず。
# virt-clone -o www -n www2 -f /var/kvm/images/www2.img
ERROR    ディスクを作成するための十分な空き領域がありません。 30720 MBの要求 > 13898 MBの空き

保存先の/var以下を明示的に容量を増やせば解決か??

0 件のコメント:

コメントを投稿