VM master disk is full
VM slave is working file
-
Log in to GCP console
-
Shut down master node
-
Click on master VM
-
Click edit on top
-
Scroll to the boot disk section
-
Change "When deleting instance" to "Keep Disk"
-
Click on x next to Keep Disk to detach disk
-
On the Bottom click Save
-
Go back to GCP compute engine console
-
click on slave VM
-
Click Edit
-
Search for Additional Disks
-
Click - Add existing Disks
-
In the Disk dropdown select the master disk
-
Click Done
-
At bottom of the page click save
-
Login to slave VM in terminal
-
Log in as root -
sudo -i
-
Execute -
lsblk
-
You should now see a new disk -
sdb
loop0 7:0 0 88.7M 1 loop /snap/core/7396
loop1 7:1 0 60.5M 1 loop /snap/google-cloud-sdk/94
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 29.9G 0 part /
├─sda14 8:14 0 4M 0 part
└─sda15 8:15 0 106M 0 part /boot/efi
sdb 8:16 0 30G 0 disk
├─sdb1 8:17 0 29.9G 0 part
├─sdb14 8:30 0 4M 0 part
└─sdb15 8:31 0 106M 0 part
-
mkdir /hdd
-
vi /etc/fstab
-
Add the below line at the end -
/dev/sdb1 /hdd ext4 defaults 0 1
-
Save the file
-
mount /hdd
-
cd /hdd
-
cd var/log/jenkins/
-
rm *.log
-
cd
-
umount /hdd
-
Go back to GCP compute engine console
-
Click on slave VM
-
Click edit
-
Search for Additional Disks button
-
Hover on Existing Disk section
-
You will get a delete icon
-
Click on the delete icon
-
Click Save at the bottom of the page
-
Go back to compute engine dashboard
-
Click on master VM
-
Click edit on top
-
Search for Boot Disk section
-
Add item -> Name - master
-
Change Device Name from Custom to Based on disk name(default) in the Device Name dropdown
-
Click save
-
Boot VM