En el presente documento se describe los comandos ejecutados para hacer un Upgarde del VM Size de la VM de JENKINS/JFROG ( de Standard D8s v3 a Standard D16s v3 -16 vcpus, 64 GiB memory) y aumentode cpacidad de disco ( 1TB a 2T)
Autor | Javier Caparo |
Version | 1.0 |
Fecha | 09/07/2021 |
login y passowrd de la VM para ingresar x ssh ( usar putty o mabaexterm como apps de acceso , o cualquiera que prefiera)
az cli ( ultima version)
Que la VM tenga configurado la opcion de Backup ( y exista al menos un backup - snapshot de la vm por los ultimos 7 dias)
Nota el dia de la ejecucion se detendra el backup para que no interrumpa el trabajo
az vm deallocate --resource-group RG-genesis-prod --name VM-genesis-devops-prod
az disk list \
--resource-group RG-genesis-prod \
--query '[*].{Name:name,Gb:diskSizeGb,Tier:accountType}' \
--output table
Reultado similar a este:
Name Gb
----------------------------------------------------------------- ----
VM-genesis-devops-prod_disk1_b3632455699c4f09a032a8b4c99e85b8 30
VM-genesis-devops-prod_disk2_97f673d0752444a08d908c8edddd7455 1023
VM-genesis-devops-prod_disk3_21366072 1000
VM-genesis-hygieia-prod_OsDisk_1_43ca81f7224b48b282eef3da36580215 30
az disk update \
--resource-group RG-genesis-prod \
--name VM-genesis-devops-prod_disk2_97f673d0752444a08d908c8edddd7455 \
--size-gb 2048
az vm start --resource-group RG-genesis-prod --name VM-genesis-devops-prod
az vm show --resource-group RG-genesis-prod --name VM-genesis-devops-prod -d --query [publicIps] --output tsv
Se ingresa a la VM x ssh
Se ve cual es el estado de los filesystem y el nuevo disco creado
df -h
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
[genesis@VM-genesis-devops-prod ~]$ lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
sda 2:0:0:0 30G
├─sda1 500M /boot
└─sda2 29.5G /
sdb 4:0:1:0 128G
└─sdb1 128G /mnt/resource
sdc 5:0:0:0 2T
└─sdc1 1023G /Volumes
sdd 5:0:0:1 1000G
└─sdd1 1000G /Backups
[genesis@VM-genesis-devops-prod ~]$
Nota : en este ejemplo,nuestro disco ya tien los 2T que se crecio en el paso anterior , pero aun no se han asignado al filesystem /Volumes (sdc1) que aun tiene 1TB.
sudo umount /dev/sdc1
[genesis@VM-genesis-devops-prod ~]$ sudo parted /dev/sdc
GNU Parted 3.1
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: Msft Virtual Disk (scsi)
Disk /dev/sdc: 2199GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 1098GB 1098GB primary xfs
(parted) resizepart
Partition number? 1
End? [1098GB]? 2199GB
(parted) print
Model: Msft Virtual Disk (scsi)
Disk /dev/sdc: 2199GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 2199GB 2199GB primary xfs
(parted) quit
HAsta aqui hemos reconocido el disco y formateado al neuvo tamaño con gparted
Ahora montamos el volumen y lo crecemos con xfs_grow ( no usar ef2dsk porque el filesystem es de tipo xfs)
genesis@demo-VM-genesis-devops:~$ sudo mount /dev/sdc1 /Volumes
genesis@demo-VM-genesis-devops:~$
genesis@demo-VM-genesis-devops:~$ sudo xfs_growfs /Volumes
meta-data=/dev/sda1 isize=512 agcount=4, agsize=65535872 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=262143488, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=127999, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 262143488 to 393215739
genesis@demo-VM-genesis-devops:~$
genesis@demo-VM-genesis-devops:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 29G 5.4G 24G 19% /
devtmpfs 3.4G 0 3.4G 0% /dev
tmpfs 3.4G 0 3.4G 0% /dev/shm
tmpfs 696M 1.1M 695M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.4G 0 3.4G 0% /sys/fs/cgroup
/dev/loop0 56M 56M 0 100% /snap/core18/2066
/dev/loop2 68M 68M 0 100% /snap/lxd/20326
/dev/loop1 56M 56M 0 100% /snap/core18/2074
/dev/loop3 33M 33M 0 100% /snap/snapd/12159
/dev/sdc15 105M 7.9M 97M 8% /boot/efi
/dev/sdb1 98G 61M 93G 1% /mnt
tmpfs 696M 0 696M 0% /run/user/1000
/dev/sda1 1.5T 11G 1.5T 1% /Volumes/artifactory
genesis@demo-VM-genesis-devops:~$
sudo mount /dev/sda1 /Volumes/artifactory
```bash
Nota: Si al crecer dice que hay un error para reparar usar "xfs_repair" como aqui se detalla:
```bash
genesis@demo-VM-genesis-devops:~$ sudo xfs_repair /dev/sdc1
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
- scan filesystem freespace and inode maps...
- found root inode chunk
Phase 3 - for each AG...
- scan and clear agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
Phase 5 - rebuild AG headers and trees...
- reset superblock...
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- traversing filesystem ...
- traversal finished ...
- moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
done******************************************************************
az vm list-vm-resize-options --resource-group RG-genesis-prod --name VM-genesis-devops-prod --output table
az vm resize --resource-group RG-genesis-prod --name VM-genesis-devops-prod --size Standard_D16s_v3
az aks get-upgrades --resource-group RG-genesis-prod --name aks-genesis-prod --output table
WARNING: The behavior of this command has been altered by the following extension: aks-preview
Name ResourceGroup MasterVersion Upgrades
------- --------------- --------------- ----------------
default RG-genesis-prod 1.15.10 1.18.17, 1.18.19
az aks upgrade \
--resource-group RG-genesis-prod \
--name aks-genesis-prod \
--kubernetes-version 1.18.17
Imagenes de la VM actualemnte:
FIN !!!