Loading...
 

Adding Disks to DomU and increasing Logical Volume Size

On the Dom0

Create a new logical volume

This will be the physical disk on the DomU
root@mk-vmhost-1:~# lvcreate -L 5G -n mk-scripts-1-pv2 DomU
Logical volume “mk-scripts-1-pv2” created

Add the new disk to the DomU

list the current disks
root@mk-vmhost-1:~# xm block-list mk-scripts-1
Vdev BE handle state evt-ch ring-ref BE-path
51712 0 0 4 9 8 /local/domain/0/backend/vbd/32/51712
51728 0 0 4 10 9 /local/domain/0/backend/vbd/32/51728
51744 0 0 4 11 10 /local/domain/0/backend/vbd/32/51744

Attach the disk
root@mk-vmhost-1:~# xm block-attach mk-scripts-1 phy:/dev/DomU/mk-scripts-1-pv2 xvdd w

root@mk-vmhost-1:~# xm block-list mk-scripts-1
Vdev BE handle state evt-ch ring-ref BE-path
51712 0 0 4 9 8 /local/domain/0/backend/vbd/32/51712
51728 0 0 4 10 9 /local/domain/0/backend/vbd/32/51728
51744 0 0 4 11 10 /local/domain/0/backend/vbd/32/51744
51760 0 0 4 13 853 /local/domain/0/backend/vbd/32/51760

If the devic needs removing, use: xm block-detach mk-scripts-1 51760

Update the config file

This is just done to keep the config backup up-to-date. Should the domain have to be rebuilt in xend, we don’t want it to miss the new disk

edit the DomU config

root@mk-vmhost-1:~# vi /etc/xen/vm/conf.d/mk-scripts-1.cfg
Change:
disk = ‘phy:/dev/DomU/mk-scripts-1-root,xvda,w’, ‘phy:/dev/DomU/mk-scripts-1-swap,xvdb,w’, ‘phy:/dev/DomU/mk-scripts-1-pv1,xvdc,w’
To:
disk = ‘phy:/dev/DomU/mk-scripts-1-root,xvda,w’, ‘phy:/dev/DomU/mk-scripts-1-swap,xvdb,w’, ‘phy:/dev/DomU/mk-scripts-1-pv1,xvdc,w’, ‘phy:/dev/DomU/mk-scripts-1-pv2,xvdd,w’

On the DomU


Expand the Volume Group and Logical Volume