[Kimchi-devel] [RFC] create a vm on a lun directly

Shu Ming shuming at linux.vnet.ibm.com
Mon Mar 17 15:20:12 UTC 2014


2014-03-17Mo的 17:01 +0800,Sheldon:
> Now we have support iSCSI or SCSI pool.
> But we do not make use of the iSCSI or SCSI pool at present.
> 
> Here we want to create volumes for VM in those pools.
> The best way to do it is on template level - and not on vm level
> 
> For if we create a template just assign a iSCSI or SCSI pool, the user 
> still need to choose
> a volume for his VM.
> 
> in the edit template page, we list the storage pool and the volume
> like:
> dir-pool-1
> nfs-pool-2
> iscsi-pool-1/lun-1
> iscsi-pool-1/lun-2
> iscsi-pool-1/lun-3
> scsi-pool-1/lun-1
> scsi-pool-1/lun-2
> 
> when selecting the storage pool with type iSCSI or SCSI the user also 
> select the volume.
> 
> The user can create a VM with this volume.

Most likely, the user doesn't expect to share the volume with other VMs.
So the template with a specific lun here is a one time template which
can be used only  create one VM. If it is a one time only, the template
with a specific lun doesn't get much meaning as a template to clone
multiple VMs.  I would suggest to create another storage pool type like
'scsi-luns-pool' which contains luns from scsi or iSCSI targets.  We can
define the template with such a storage type.  It is Kimchi's pool
management method to decide which lun in the storage pool will be
selected for the volume of the VM.  For example, the luns with the
nearest size are chosen. Also, other methods are provided to import luns
into the pool or release luns from the pool &etc.  As we have reference
count for storage volumes, that can also applies to luns.

> 
> But we should let user know it is dangerous to avoid user mistake when 
> he choose the volume.
> 
> 1. Now we only use the volume to create the vm not support shareable volume.
> use the same volume in multiples vms, a new install will overwrite the 
> current content.
> We can check the volume ref_cnt to avoid this.
> 

It is quite arguable what happens if the user tries to import a luns
with data on them into a storage pool in Kimchi.  I think we should wran
the user, but it is the user's responsibility to make sure the useful
data will not be corrupted.


> 2. even this lun is not used buy vm, maybe the Adam has added a lun to a 
> VG or use it on other purpose
> Should we check the lun is is used external kimchi?
> If a lun is added to a VG, need to check it?
> If adam format a lun and create a files system on, need to check it?
> Or we just prompt the data on this volume will destroyed.
> 
> 





More information about the Kimchi-devel mailing list