Attach disk doesn't check cluster compatibility.
|Assignee:||Guillaume Oberlé||% Done:|
|Category:||Core & System|
|Target version:||Release 4.14|
Attaching a disk doesn't check that the datastore of the image is in the same cluster as the host where the VM is running. The template instantiation seems not impacted by the bug, the scheduler returns an error if the image datastore are in different clusters.
Example : I have two cluster and each cluster have it's own image/system datastore assigned. I create a new VM in cluster1 and I'm able to attach a disk from the image datastore assigned to cluster 2. This is problematic because, imagine you have a cluster with hypervisors configured for ceph storage (no disks) and another one with hypervisors that have local storage, you don't want users to be able to assign local disks on VMs in the Ceph cluster.
In fact it's a bit more complicated than that, here are the 4 different possibilities I saw :
- VM's host and the image datastore are in the same cluster => should allowed to attach disk.
- VM's host is in a cluster and the image datastore is not in a cluster => should allowed to attach disk (the datastore is considered available for every cluster).
- VM's host is not in a cluster and the image datastore is in a cluster => should not allowed to attach disk (the datastore is reserved for the cluster).
- VM's host is in a cluster and the image datastore is in another cluster => should not allowed to attach disk.