Skip to content

Commit

Permalink
Increase gateway VMSS disk storage (#2978)
Browse files Browse the repository at this point in the history
This PR increaseses the OS disk to 256GB, from the default value of 64GB for both the rpVMSS and gatewayVMSS.
The root filesystem is grown to a smaller percentage now because 50% of the disk would mostly go unused.

This is needed because the gateway container writes directly to the root of it's filesystem, which is mounted in /var/containers.
The gateway log is not currently rotated, so an increase in logging can and will result in a full disk halting the VM.
  • Loading branch information
s-fairchild authored Jun 23, 2023
1 parent 738a5e6 commit 000562d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pkg/deploy/assets/gateway-production.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/deploy/assets/rp-production.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/deploy/generator/resources_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ func (g *generator) gatewayVMSS() *arm.Resource {
ManagedDisk: &mgmtcompute.VirtualMachineScaleSetManagedDiskParameters{
StorageAccountType: mgmtcompute.StorageAccountTypesPremiumLRS,
},
DiskSizeGB: to.Int32Ptr(256),
},
},
NetworkProfile: &mgmtcompute.VirtualMachineScaleSetNetworkProfile{
Expand Down
1 change: 1 addition & 0 deletions pkg/deploy/generator/resources_rp.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ func (g *generator) rpVMSS() *arm.Resource {
ManagedDisk: &mgmtcompute.VirtualMachineScaleSetManagedDiskParameters{
StorageAccountType: mgmtcompute.StorageAccountTypesPremiumLRS,
},
DiskSizeGB: to.Int32Ptr(256),
},
},
NetworkProfile: &mgmtcompute.VirtualMachineScaleSetNetworkProfile{
Expand Down
11 changes: 9 additions & 2 deletions pkg/deploy/generator/scripts/gatewayVMSS.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

echo "setting ssh password authentication"
# We need to manually set PasswordAuthentication to true in order for the VMSS Access JIT to work
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
Expand All @@ -9,14 +11,19 @@ yum update -y --disablerepo='*' --enablerepo='rhui-microsoft-azure*'
echo "running yum update"
yum -y -x WALinuxAgent -x WALinuxAgent-udev update --allowerasing

echo "extending partition table"
# Linux block devices are inconsistently named
# it's difficult to tie the lvm pv to the physical disk using /dev/disk files, which is why lvs is used here
physicalDisk="$(lvs -o devices -a | head -n2 | tail -n1 | cut -d ' ' -f 3 | cut -d \( -f 1 | tr -d '[:digit:]')"
growpart "$physicalDisk" 2

echo "extending filesystems"
lvextend -l +50%FREE /dev/rootvg/rootlv
lvextend -l +20%FREE /dev/rootvg/rootlv
xfs_growfs /

lvextend -l +100%FREE /dev/rootvg/varlv
xfs_growfs /var


rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
rpm --import https://packages.microsoft.com/keys/microsoft.asc

Expand Down
10 changes: 9 additions & 1 deletion pkg/deploy/generator/scripts/rpVMSS.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

echo "setting ssh password authentication"
# We need to manually set PasswordAuthentication to true in order for the VMSS Access JIT to work
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
Expand All @@ -9,8 +11,14 @@ yum update -y --disablerepo='*' --enablerepo='rhui-microsoft-azure*'
echo "running yum update"
yum -y -x WALinuxAgent -x WALinuxAgent-udev update --allowerasing

echo "extending partition table"
# Linux block devices are inconsistently named
# it's difficult to tie the lvm pv to the physical disk using /dev/disk files, which is why lvs is used here
physicalDisk="$(lvs -o devices -a | head -n2 | tail -n1 | cut -d ' ' -f 3 | cut -d \( -f 1 | tr -d '[:digit:]')"
growpart "$physicalDisk" 2

echo "extending filesystems"
lvextend -l +50%FREE /dev/rootvg/rootlv
lvextend -l +20%FREE /dev/rootvg/rootlv
xfs_growfs /

lvextend -l +100%FREE /dev/rootvg/varlv
Expand Down

0 comments on commit 000562d

Please sign in to comment.