Difference between revisions of "VT-CloudCaps:BestPractices"
(→Images) |
|||
Line 7: | Line 7: | ||
==== Images ==== | ==== Images ==== | ||
When you upload a file containing the file system of a virtual machine (image of a single partition or the whole disk, it doesn't matter at this point) to OpenNebula and register it as an '''IMAGE''', it becomes attachable but not resizeable. This means you will be able to create a virtual machine using this '''IMAGE''' but you won't be able to change its size during instantiation or expand its file system to fill a bigger '''IMAGE'''. | When you upload a file containing the file system of a virtual machine (image of a single partition or the whole disk, it doesn't matter at this point) to OpenNebula and register it as an '''IMAGE''', it becomes attachable but not resizeable. This means you will be able to create a virtual machine using this '''IMAGE''' but you won't be able to change its size during instantiation or expand its file system to fill a bigger '''IMAGE'''. | ||
The only way to add more block storage to a virtual machine is to create a special empty IMAGE using type DATABLOCK and attach it as a new block device. This means that storage space can be added only to a new mount point inside the virtual machine. | |||
==== Virtual machine templates ==== | ==== Virtual machine templates ==== | ||
==== Examples ==== | |||
* Example #1 | |||
<pre> | |||
I have a raw disk image containing an MBR and a single partition | |||
with the root file system of an arbitrary Linux distribution. | |||
This image has the following attributes: | |||
-- 4 GB of space in total | |||
-- 2 GB taken by the OS installation | |||
-- no fs encryption, no LVM, no swap | |||
-- credentials for root access are already included | |||
-- everything is stored in a single file my_cloud_vm.img | |||
Once I upload and register this file as an IMAGE in OpenNebula, it | |||
becomes available as IMAGE_ID = 1 and I will use it to instantiate | |||
a virtual machine. | |||
When log into the running virtual machine, I realize that there is | |||
not enough space to install the software or copy the data I need to | |||
run my computing job. | |||
The only way to solve this problem /without expanding, uploading | |||
and registering a new (and bigger) IMAGE/ is to attach a DATABLOCK | |||
and mount it inside the virtual machine as a new mount point. | |||
There is no way to expand the existing root file system or IMAGE | |||
itself once it is registered in OpenNebula. | |||
</pre> | |||
* Example #2 | |||
<pre> | |||
</pre> | |||
=== OpenStack === | === OpenStack === | ||
== Checklist == | == Checklist == |
Revision as of 22:20, 20 April 2013
This page details the dos and don'ts of image creation when it comes to leveraging various cloud capabilities and achieving multi-platform compatibility.
Basics
Platform-specific practices
OpenNebula
If you want to leverage some platform-specific features provided by OpenNebula and use workflows endorsed by its community, you should follow a few recommendations regarding image creation. This is especially important for users coming to OpenNebula from other cloud platforms, such as OpenStack. In order to understand these recommendations, you first have to understand how OpenNebula works with block storage, images and virtual machines in general.
Images
When you upload a file containing the file system of a virtual machine (image of a single partition or the whole disk, it doesn't matter at this point) to OpenNebula and register it as an IMAGE, it becomes attachable but not resizeable. This means you will be able to create a virtual machine using this IMAGE but you won't be able to change its size during instantiation or expand its file system to fill a bigger IMAGE.
The only way to add more block storage to a virtual machine is to create a special empty IMAGE using type DATABLOCK and attach it as a new block device. This means that storage space can be added only to a new mount point inside the virtual machine.
Virtual machine templates
Examples
- Example #1
I have a raw disk image containing an MBR and a single partition with the root file system of an arbitrary Linux distribution. This image has the following attributes: -- 4 GB of space in total -- 2 GB taken by the OS installation -- no fs encryption, no LVM, no swap -- credentials for root access are already included -- everything is stored in a single file my_cloud_vm.img Once I upload and register this file as an IMAGE in OpenNebula, it becomes available as IMAGE_ID = 1 and I will use it to instantiate a virtual machine. When log into the running virtual machine, I realize that there is not enough space to install the software or copy the data I need to run my computing job. The only way to solve this problem /without expanding, uploading and registering a new (and bigger) IMAGE/ is to attach a DATABLOCK and mount it inside the virtual machine as a new mount point. There is no way to expand the existing root file system or IMAGE itself once it is registered in OpenNebula.
- Example #2