Difference between revisions of "Workaround Attach Additional Disk to VM"

From stoney cloud
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Abstract)
(Part I)
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
* Update the VMs configuration data in the LDAP directory
 
* Update the VMs configuration data in the LDAP directory
* Manually reate the virtual disk
+
* Manually create the virtual disk
 
* Regenerate the VM configuration on the node
 
* Regenerate the VM configuration on the node
  
Line 13: Line 13:
 
== Part I ==
 
== 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''')
+
* In the vm-manager: Expand the VM entry for the VM you want to add an additional disk to and note the UUID below VM name ('''$VMUUID''')
* Use <code>uuidgen</code> and generate a new UUID ('''$DISKUUID''')
+
* In a shell: Use <code>uuidgen</code> and generate a new UUID ('''$DISKUUID''')
 
* Calculate the size of the new disk in bytes: <code>N * 1073741824</code> for N gigabyte ('''$DISKSIZE''')
 
* Calculate the size of the new disk in bytes: <code>N * 1073741824</code> for N gigabyte ('''$DISKSIZE''')
 
* Open the URL http://YOURSTONEYCLOUD/phpldapadmin/ and login using <code>dc=Manager,...</code>
 
* Open the URL http://YOURSTONEYCLOUD/phpldapadmin/ and login using <code>dc=Manager,...</code>
* Navigate to: <code>sstDisk=vda,ou=devices,sstVirtualMachine='''$VMUUID''',ou=virtual machines,ou=virtualization,ou=services,dc=foss-cloud,dc=org</code> using the tree structure on the left
+
* Navigate to: <code>sstDisk=vda,ou=devices,sstVirtualMachine='''$VMUUID''',ou=virtual machines,ou=virtualization,ou=services,dc=stoney-cloud,dc=org</code> using the tree structure on the left
 
* Click on <code>Copy or move this entry</code> and choose <code>sstDisk=vdb,ou=devices,sstVirtualMachine='''$VMUUID''',ou=virtual machines,ou=virtualization,ou=services,dc=foss-cloud,dc=org</code> as <code>Destination DN</code>
 
* Click on <code>Copy or move this entry</code> and choose <code>sstDisk=vdb,ou=devices,sstVirtualMachine='''$VMUUID''',ou=virtual machines,ou=virtualization,ou=services,dc=foss-cloud,dc=org</code> as <code>Destination DN</code>
 
* Replace:
 
* Replace:
Line 34: Line 34:
 
* Run: <code>chown root:vm-storage /var/virtualization/vm-*/'''$POOLUUID'''/'''$DISKUUID'''.qcow2</code>
 
* Run: <code>chown root:vm-storage /var/virtualization/vm-*/'''$POOLUUID'''/'''$DISKUUID'''.qcow2</code>
 
* Run: <code>chmod g+rw /var/virtualization/vm-*/'''$POOLUUID'''/'''$DISKUUID'''.qcow2</code>
 
* Run: <code>chmod g+rw /var/virtualization/vm-*/'''$POOLUUID'''/'''$DISKUUID'''.qcow2</code>
* Switch to the stoney cloud webinterface again and shutdown the VM (if not already done)
+
 
 +
== Part III ==
 +
 
 +
* Open the stoney cloud webinterface (vm-manager)
 +
* Shutdown the VM (if not already done)
 
* Click first on the <code>edit VM</code> icon and then <code>save</code> (without changing anything)
 
* Click first on the <code>edit VM</code> icon and then <code>save</code> (without changing anything)
 
* Start the VM again
 
* Start the VM again
  
 
[[Category:Workarounds]]
 
[[Category:Workarounds]]

Latest revision as of 12:14, 2 May 2014

Abstract

It is currently not possible to attach additional virtual disks directly via the webinterface.

What you do in principle:

  • Update the VMs configuration data in the LDAP directory
  • Manually create the virtual disk
  • Regenerate the VM configuration on the node

Step by step

Part I

  • In the vm-manager: Expand the VM entry for the VM you want to add an additional disk to and note the UUID below VM name ($VMUUID)
  • In a shell: 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=stoney-cloud,dc=org using the tree structure on the left
  • Click on Copy or move this entry and choose sstDisk=vdb,ou=devices,sstVirtualMachine=$VMUUID,ou=virtual machines,ou=virtualization,ou=services,dc=foss-cloud,dc=org as Destination DN
  • Replace:
    • the UUID in sstVolumeName
    • and the same UUID in sstSourceFile with $DISKUUID (warning: in sstSourceFile are at least two UUIDs, replace only the one matching sstVolumeName)
    • the value in sstVolumeCapacity by $DISKSIZE
  • Click on Create and confirm with Commit
  • 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/vm-*/$POOLUUID/$DISKUUID.qcow2
  • Run: chmod g+rw /var/virtualization/vm-*/$POOLUUID/$DISKUUID.qcow2

Part III

  • Open the stoney cloud webinterface (vm-manager)
  • Shutdown the VM (if not already done)
  • Click first on the edit VM icon and then save (without changing anything)
  • Start the VM again