applies to VIRL-CORE: all versions
(not applicable to bare-metal deployments)
Your VIRL server; while a virtual machine, has its own hard disk completely separated from your physical machine (albeit in software only). Depending on how you use VIRL you may find that your initial VIRL server hard drive is not large enough for your projects and images. This can be a major problem for a physical system as well as on a virtual machine. As long as your physical system has enough free space, you can easily extend the virtual hard disk (vmdk) of your VIRL server.
The steps highlighted here show VMWare Fusion but the same procedure may adopted for ESXi, Workstation and Player deployments.
While these steps are safe, deviating from this procedure can cause complete loss of data. It is strongly advised that you read the procedure first BEFORE you begin.
- Shutdown your VIRL server cleanly. If you server is running, you may shut it down via command line or from the VIRL server desktop.
sudo shutdown -h now
- Create a backup or your VIRL server. The easiest and probably the fastest, is just to make a copy of your VIRL server virtual machine directory. Just make sure that you copy ALL of the contents to a safe location. Alternatively, you can create a Full Clone from the VMWare interface. If you choose to clone your server, be patient and wait for the process to complete before you continue. Do not use Linked Clone or create a Snapshot!
- Download gParted live CD (GNOME Partition Editor) from GParted.org and save the ISO file to your computer
- Edit the settings of your VIRL server virtual machine and set the CD/DVD drive to use the gParted ISO image
- Now give the hard disk more space. Increase the size of the disk accordingly while ensuring that your physical system has the available space.
- Set the VIRL server virtual machine to start from the gParted ISO image attached to the CD/DVD drive. Click on Start Up Disk, select CD/DVD, click Restart
- Take all the defaults settings when prompted. Once the server has finished booting, you should have gParted GUI open and ready to use
- Select the lvm2 partition which should be labeled virl-vg; next right click and select Deactivate'
- You should not longer see the lock icon on '/dev/sda2' or '/dev/sda5'
- Select '/dev/sda2' and then click on Resize/Move button
- Drag the bar to expand the partition or type the maximum size in the New size (MiB)'field
- Click on Resize/Move button to set the new size of the partition
- Repeat steps 10 and 11; this time select '/dev/sda5' partition.
- You should now see the pending changes at the bottom of the gParted GUI
- Click Apply to commit the new size of the partitions and then confirm you want to keep the changes
- Quit gParted application (ctrl+q); or from GParted menu
- Double click on the Exit icon on the desktop and shutdown your VIRL server virtual machine
- The Virtual machine settings window should now be visible; change the start up disk to Hard Disk (scsi) and close the settings window
- Click the Play button to start your VIRL server and log in
- Open a terminal window and become root user
- Next we are going to tell the operating system to use the additional space. Pay close attention to the commands and any system messages
- Extend the Volume Group
lvextend -l +100%FREE /dev/mapper/virl--vg-root
- Extend the root partition
- Confirm size of your disk
- Note that your hard drive will not show the exact size you set in the virtual machine settings earlier (100GB in this example). This is expected and normal operation.
Your system is now ready for use.