How to: Extending the VIRL PE virtual disk

    applies to VIRL-CORE: all versions

    (not applicable to bare-metal deployments)

    INTRODUCTION

     

    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.

     

    GETTING STARTED

     

    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.

     

    1. 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
    2. 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!
    3. Download gParted live CD (GNOME Partition Editor) from GParted.org and save the ISO file to your computer
    4. Edit the settings of your VIRL server virtual machine and set the CD/DVD drive to use the gParted ISO image3e175997d3dd8ac7.png
    5. Now give the hard disk more space. Increase the size of the disk accordingly while ensuring that your physical system has the available space. Screenshot 2016-04-15 13.05.19.png
    6. 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 RestartScreenshot 2016-04-15 13.08.00.pngScreenshot 2016-04-15 13.07.43.png
    7. Take all the defaults settings when prompted. Once the server has finished booting, you should have gParted GUI open and ready to use
    8. Select the lvm2 partition which should be labeled virl-vg; next right click and select Deactivate' Screenshot 2016-04-15 15.05.27.png
    9. You should not longer see the lock icon on '/dev/sda2' or '/dev/sda5'
    10. Select '/dev/sda2' and then click on Resize/Move button
    11. Drag the bar to expand the partition or type the maximum size in the New size (MiB)'field72ee1d3e69564c81.png
    12. Click on Resize/Move button to set the new size of the partition
    13. Repeat steps 10 and 11; this time select '/dev/sda5' partition.
    14. You should now see the pending changes at the bottom of the gParted GUIScreenshot 2016-04-15 15.25.33.png
    15. Click Apply to commit the new size of the partitions and then confirm you want to keep the changes
    16. Quit gParted application (ctrl+q); or from GParted menu
    17. Double click on the Exit icon on the desktop and shutdown your VIRL server virtual machine
    18. The Virtual machine settings window should now be visible; change the start up disk to Hard Disk (scsi) and close the settings window
    19. Click the Play button to start your VIRL server and log in
    20. Open a terminal window and become root user
      • sudo su
    21. Next we are going to tell the operating system to use the additional space. Pay close attention to the commands and any system messages
    22. Extend the Volume Group
      • lvextend -l +100%FREE /dev/mapper/virl--vg-root
    23. Extend the root partition
      • xfs_growfs /
    24. Confirm size of your disk
      • df -h
    25. 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.