Skip to main content
  1. Posts/

Xenserver and adding/attaching a new storage to a VM

··247 words·2 mins·
Tips & How-To's Virtualization

I had an instance today where a local VM(which is provisioned by Xenserver) was running low on disk space and wanted to increase the disk space allocated to it. Last time when I did it by increasing the space from within Xen Manager, I failed miserably(the VM was configured with LVM and neither pvscan or lvscan was able to see the increased space).

This time I tried a different approach:

  • rather than increasing the space of the attached disk, I created a new disk and attach it to the VM from Xenserver Management Console
  • Since the VM is configured with LVM, I decided to add the new disk as a Physical Volume(PV) and then extend the Logical Volume(LV) & Volume Group(VG)

Creating a new disk and attaching it to the VM from Xenserver management Console is fairly straightforward. First make note of the device to which the new disk is attached to. In this case, it is assumed to be xvdc. I’m also assuming that the volume group mesa-nl-vg exists and /dev/mapper/mesa-nl-vg-root is the logical volume path

Here’s the steps ahead

  • Create new partition

    sudo fdisk /dev/xvdc
    
  • Create a new PV

    sudo pvcreate /dev/xvdc1
    
  • Extend the VG

    sudo vgextend mesa-nl-vg /dev/xvdc1
    
  • Extend LV. Note that the +100G indicates the size by which it should be increased

    sudo lvextend -L+100G /dev/mapper/mesa--nl--vg-root
    
  • Resize the filesystem

    sudo resize2fs /dev/mapper/mesa--nl--vg-root
    

HowToGeek has a nice writeup & cheatsheet on LVM, you should read that to get you up to speed with LVM.

Sathyajith Bhat
Author
Sathyajith Bhat
Author, AWS Container Hero and DevOps Specialist.

Related

Bash bashings..
··131 words·1 min
Tips & How-To's Bash Linux Popd Pushd
Since my new job involves lot more of Linux, shell scripting bash and automation, I’ve been trying to brush up my Linux skills. Ran into this “problem” today where there’s an init script which handles unicorn start/stop/reload and we were debugging some kinks around this. The init script had a chain of cd to the directory and the unicorn invoke script. Was trying to figure out why unicorn wasn’t starting up, till I read a bit more and dropped to using echo to understand what’s happening
Implementing and Triggering Google Now Cards & Gmail actions from Email
··900 words·5 mins
Tips & How-To's Programmming
For every Barcamp event that comes and goes by, I try to think of what new thing I can do to make it a bit better. Off late, I’ve been using Inbox by Gmail almost exclusively. I love the product, particularly for the cards that show up that gives you a brief info about the mail(ex: Event reservation details/Flight details etc) without even opening the email. I noticed that Meetup does the same.
Getting php mail() function running on Windows 8.1 with WAMP Server and configuring it to use Gmail’s SMTP servers
··289 words·2 mins
Tips & How-To's PHP Sendmail
With the next Barcamp Bangalore looming round the corner, I’d pitched in to help with some of the website tasks. I installed the traditional WAMP stack with WAMP Server for Windows and started working with WordPress. Needed to get the email notifications working, saw that it wasn’t. Bit of research & found that I’d need a SMTP server or an equivalent of sendmail. All the cool kids seem to be using Fake sendmail - I tried it to use with Gmail’s SMTP servers which uses authentication & TLS.