Difference between revisions of "Workaround Attach Additional Disk to VM"
From stoney cloud
[unchecked revision] | [unchecked revision] |
(Created page with "= Abstract = It is currently not possible to attach additional virtual disks directly via the default webinterface. What you do in principle: * Update the VMs configuration...") |
(→Part II) |
||
Line 30: | Line 30: | ||
* Login to the VM node on which the VM is/was running | * Login to the VM node on which the VM is/was running | ||
− | * Run the following command as root: <code>virsh vol-create-as '''POOLUUID''' '''DISKUUID'''.qcow2 '''DISKSIZE''' --allocation 0</code> | + | * Run the following command as root: <code>virsh vol-create-as '''POOLUUID''' '''DISKUUID'''.qcow2 '''DISKSIZE''' --format qcow2 --allocation 0</code> |
* You should get <code>Vol '''DISKUUID'''.qcow2 created</code> | * You should get <code>Vol '''DISKUUID'''.qcow2 created</code> | ||
* Run: <code>chown root:vm-storage /var/virtualization/'''POOLUUID'''/'''DISKUUID'''.qcow2</code> | * Run: <code>chown root:vm-storage /var/virtualization/'''POOLUUID'''/'''DISKUUID'''.qcow2</code> |
Revision as of 14:10, 22 July 2013
Contents
Abstract
It is currently not possible to attach additional virtual disks directly via the default webinterface.
What you do in principle:
- Update the VMs configuration data in the LDAP directory
- Manually reate the virtual disk
- Regenerate the VM configuration on the node
Step by step
Part I
- Expand the VM entry for the VM you want to add an additional disk to and note the UUID below VM name (VMUUID)
- Use
uuidgen
and generate a new UUID (DISKUUID) - Calculate the size of the new disk in bytes:
N * 1073741824
for N gigabyte (DISKSIZE) - Open the URL http://YOURSTONEYCLOUD/phpldapadmin/ and login using
dc=Manager,...
- Navigate to:
sstDisk=vda,ou=devices,sstVirtualMachine=VMUUID,ou=virtual machines,ou=virtualization,ou=services,dc=foss-cloud,dc=org
using the tree structure on the left - Click on
Copy or move this entry
and choosesstDisk=vdb,ou=devices,sstVirtualMachine=VMUUID,ou=virtual machines,ou=virtualization,ou=services,dc=foss-cloud,dc=org
asDestination DN
- Replace:
- the UUID in
sstVolumeName
- and the same UUID in
sstSourceFile
with DISKUUID (warning: insstSourceFile
are at least two UUIDs, replace only the one matchingsstVolumeName
) - the value in
sstVolumeCapacity
by DISKSIZE
- the UUID in
- Click on
Create
and confirm withCommit
- You should get:
Creation successful!
- Note the first UUID in the attribute
sstSourceFile
(POOLUUID)
Part II
- Login to the VM node on which the VM is/was running
- Run the following command as root:
virsh vol-create-as POOLUUID DISKUUID.qcow2 DISKSIZE --format qcow2 --allocation 0
- You should get
Vol DISKUUID.qcow2 created
- Run:
chown root:vm-storage /var/virtualization/POOLUUID/DISKUUID.qcow2
- Run:
chmod g+rw /var/virtualization/POOLUUID/DISKUUID.qcow2
- Switch to the stoney cloud webinterface again and shutdown the VM (if not already done)
- Click first on the
edit VM
icon and thensave
(without changing anything) - Start the VM again