[RFC] create a vm on a lun directly

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. 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. 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. -- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center

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.

On 03/17/2014 06:01 AM, Sheldon wrote:
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.
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.
As you mentioned below the LUN can be used outside Kimchi so check volume ref_cnt will not prevent the error. I suggest to warn the user about the operation (same we did while creating a logical pool) and if he/she confirm the operation we create the vm. For example: when user selects a template with a specific LUN we display a confirmation window: "This will cause lost of data in the LUN <lun-name>. Are you sure to continue?"
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.

On 03/17/2014 06:01 AM, Sheldon wrote:
Now we have support iSCSI or SCSI pool. But we do not make use of the iSCSI or SCSI pool at present.
Yes, we do. Backend is ready, it is possible to pass the volume you want to user to VM when creating it. Problem is that UI is not ready (actually, I had developed, it worked, but it was not accepted, so we are waiting from UI guys).
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
I had a lot of discussions with Aline about this. Volumes in iSCSI and SCSI (Fibre Channel) pools cannot be done via libvirt. They should be created outside of Kimchi by the administrators. Also, due to the architecture of Kimchi, we cannot mix disks from 2 different types of storage pools, for instance: I cannot have a vm with 2 disks, where one comes from a SCSI pool and other is a .img in a DIR pool.
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.
I have to agree with Ming, this does not makes sense... it is the same that create a .img in template level and left it assigned forever in the template. User would need to create a new template for each volume or edit the template for each new VM he wants to create.
The user can create a VM with this volume.
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.
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.
Regarding SCSI (Fibre Channel) and, probably, iSCSI pools .... I know that what is missing is to use the LUNs as Filesystem pools. So, the LUN will store the disk images used by VMs.
participants (4)
-
Aline Manera
-
Rodrigo Trujillo
-
Sheldon
-
Shu Ming