Introdução
Este documento descreve como aumentar o tamanho do disco na máquina virtual subjacente que executa um Performance Manager UCS (UCSPM) em um host de VMware ESXi.
Problema
Às vezes quando a separação da raiz do UCSPM se torna completamente, o sistema não funciona corretamente. Uma razão é que os arquivos de registro criados pelo aplicativo próprio se tornam demasiado grandes.
Solução
Antes que você comece, você deve primeiramente fechar a máquina virtual UCSMPM. Então conecte ao host CLI de ESXi com o Shell Seguro (ssh) e encontre o arquivo do vmdk no datastore.
- A fim estender o espaço no arquivo de disco atual da máquina virtual a um comprimento especificado novo, incorpore os vmkfstools comandam no host de ESXi.
/vmfs/volumes/datastore/ucspm11.cisco.lab # vmkfstools
--extendvirtualdisk 200G ucspm11.cisco.lab.vmdk
Grow: 100% done.
- Verifique o estado de sistema do arquivo atual com estes comandos:
[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
- O disco já tem uma capacidade maior contudo que o espaço novo precisa de ser atribuído. Crie a separação preliminar nova. A fim executar esta tarefa incorpore estes cinco comandos:
- p - Mostra o estado atual da separação
- n - Cria uma separação nova
- p - Cria uma separação preliminar
- 3 - Número de partição
- w - Escreve mudanças ao disco
[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.
- A repartição do sistema é exigida a fim aplicar as mudanças na tabela da separação.
[root@localhost ~]# shutdown -r now
- Incorpore o comando do fdisk a fim verificar que a separação nova esteve criada com sucesso.
[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
- Estenda o grupo de volume atual (VolGroup) recentemente pelo partição criada.
[root@localhost ~]# vgextend VolGroup /dev/sda3
Volume group "VolGroup" successfully extended
O comando vgdisplay mostra a informação detalhada sobre o grupo de volume, o tamanho total, e as unidades físicas livres das extensões (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
- Estenda o volume lógico que é montado como uma separação da raiz (/dev/mapper/VolGroup-lv_root). - L parâmetro especifica a extensão das unidades físicas livres das extensões.
Neste exemplo, o valor de Alloc PE/tamanho do comando precedente é 25799. Não esqueça sobre + sinal aqui de outra maneira que você pode destruir o sistema.
[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
- Incorpore estes comandos a fim verificar o tamanho e os atributos lógicos atuais do volume para o grupo de volume a fim ver discos físicos associados:
[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
- Depois que o volume lógico é aumentado, amplie o sistema de arquivos da raiz pelo tamanho lógico novo do volume.
[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.
O uso do espaço de disco do sistema de arquivos deve agora mostrar um tamanho prolongado novo.
[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