[openstack-dev] The constraints from flavor and image metadata

Jiang, Yunhong yunhong.jiang at intel.com
Tue Jan 13 21:39:50 UTC 2015

	There are some discussion and disagreement on the requirement from flavor and image metadata at nova spec https://review.openstack.org/#/c/138937/ and I want to get more input from the community. 
	When launch a VM, some requirements may come from image metadata and flavor. There are a lot of such cases like serial_port_count, memory_pagesize, hw_numa_nodes, hw:cpu_max_sockets etc. Most of them are done in nova/virt/hardware.py.

	Both the nova-spec and the current implementation seems agree that if flavor has the requirement, the image's metadata should not require more than the flavor requirement.

	However, the disagreement comes when no requirement from flavor, i.e. only image has the resource requirement. For example, for serial_port_count, "If flavor extra specs is not set, then any image meta value is permitted". For hw_mem_page_size, it's forbidden if only image request and no flavor request (https://github.com/openstack/nova/blob/master/nova/virt/hardware.py#L873 ), and hw_numa_nodes will fail if both flavor and image metadata are specified (https://github.com/openstack/nova/blob/master/nova/virt/hardware.py#L852 ). 

	As to this nova spec at https://review.openstack.org/#/c/138937/ , someone (Don, Malini) think if image requires some feature/resource that is not specified in flavor, it should be ok, while I think it should be forbidden.

	I discussed with Jay Pipe on IRC before and he thought if flavor has no requirement, image requirement should be failed, and I created a bug at https://bugs.launchpad.net/nova/+bug/1403276 at that time.  But according to the discussion on this BP, seems this is not always accepted by others.

	I hope to get feedback from the mailing list on the relationship of requirement from image/flavor. Possibly we should take different policy for different resource requirement, but some general rule and the reason for those rules will be helpful.

	BTW, This topic was sent to the operator ML yesterday by Malini at 
 This http://lists.openstack.org/pipermail/openstack-operators/2015-January/005882.html and I raise it here to cover both lists.


More information about the OpenStack-dev mailing list