[nova] Per-instance serial number implementation question

Jay Pipes jaypipes at gmail.com
Fri Jan 25 15:18:36 UTC 2019


On 01/24/2019 09:20 PM, melanie witt wrote:
> On Thu, 24 Jan 2019 09:09:07 -0600, Matt Riedemann <mriedemos at gmail.com> 
> wrote:
>> The proposal from the spec for this feature was to add an image property
>> (hw_unique_serial), flavor extra spec (hw:unique_serial) and new
>> "unique" choice to the [libvirt]/sysinfo_serial config option. The image
>> property and extra spec would be booleans but really only True values
>> make sense and False would be more or less ignored. There were no plans
>> to enforce strict checking of a boolean value, e.g. if the image
>> property was True but the flavor extra spec was False, we would not
>> raise an exception for incompatible values, we would just use OR logic
>> and take the image property True value.
>>
>> The boolean usage proposed is a bit confusing, as can be seen from
>> comments in the spec [1] and the proposed code change [2].
>>
>> After thinking about this a bit, I'm now thinking maybe we should just
>> use a single-value enum for the image property and flavor extra spec:
>>
>> image: hw_guest_serial=unique
>> flavor: hw:guest_serial=unique
>>
>> If either are set, then we use a unique serial number for the guest. If
>> neither are set, then the serial number is based on the host
>> configuration as it is today.
>>
>> I think that's more clear usage, do others agree? Alex does. I can't
>> think of any cases where users would want hw_unique_serial=False, so
>> this removes that ability and confusion over whether or not to enforce
>> mismatching booleans.
> 
> I think use of the enum makes sense and it happens to make it easier to 
> reason about in conjunction with the [libvirt]/sysinfo_serial config 
> option, at least for me.

+1

Though as I've noted on the spec, I have no idea why we even need yet 
another extra-spec/image metadata item (particularly a libvirt-specific 
one leaking out of the API. Why can't we just always set the libvirt 
sysinfo_serial number to the instance's UUID and be done with it?

Best,
-jay



More information about the openstack-discuss mailing list