Merge ~farcaller/cloud-init:nocloud-dmi into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-06-05 |
| Approved revision: | 9c021fd4eb270a8456786e67d8e817c177a53623 |
| Merged at revision: | 802e7cb2da8e2d0225525160e6edd6b58b275b8c |
| Proposed branch: | ~farcaller/cloud-init:nocloud-dmi |
| Merge into: | cloud-init:master |
| Diff against target: |
70 lines (+37/-0) 3 files modified
cloudinit/sources/DataSourceNoCloud.py (+12/-0) doc/rtd/topics/datasources/nocloud.rst (+22/-0) tools/ds-identify (+3/-0) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Ryan Harper | 2017-05-18 | Approve on 2017-05-26 | |
| Server Team CI bot | continuous-integration | Approve on 2017-05-20 | |
|
Review via email:
|
|||
Commit Message
NoCloud: support seed of nocloud from smbios information
This allows the user to seed NoCloud in a trivial way from qemu/libvirt, by
using a stock image and passing a single command line flag.
No custom command line, no filesystem modification, no bootstrap disk image.
This is particularly handy now that Ec2 backend is discouraged from use:
https:/
LP: #1691772
Description of the Change
provide a way to seed NoCloud from network without image modification (bug 1691772).
| Scott Moser (smoser) wrote : | # |
FAILED: Continuous integration, rev:ff8b5683b0d
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 30e6420... by Vladimir Pouzanov <email address hidden> on 2017-05-18
- d7db02d... by Vladimir Pouzanov <email address hidden> on 2017-05-18
- 4e6d0db... by Vladimir Pouzanov <email address hidden> on 2017-05-18
| Vladimir Pouzanov (farcaller) wrote : | # |
Updated the docs, ordering, and fixed linter issue.
PASSED: Continuous integration, rev:4e6d0db439a
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
On Fri, 19 May 2017, Ryan Harper wrote:
> > try:
> > + # Parse the system serial label from dmi. If not empty, try parsing
> > + # like the commandline
> > + md = {}
> > + serial = util.read_
> > + if serial is not None:
>
> Your comment "if not empty" doesn't appear to match the check here.
>
> read_dmi_data may return None, or "" (see _call_dmicode which has a return "" for empty fields)
>
> serial = ""
> That returns True when checking if it is 'not None'; I think just:
>
> if serial
>
> is what we want here instead.
The comment is not right, but the function i think is fine. because
load_cmdline_data will return False on "". We do want to specifically
not pass it None. On None as the cmdline, it will call get_cmdline().
So either way is really ok, but make sure we do not pass None.
| Ryan Harper (raharper) wrote : | # |
On Fri, May 19, 2017 at 12:27 PM, Scott Moser <email address hidden> wrote:
> On Fri, 19 May 2017, Ryan Harper wrote:
>
> > > try:
> > > + # Parse the system serial label from dmi. If not empty,
> try parsing
> > > + # like the commandline
> > > + md = {}
> > > + serial = util.read_
> > > + if serial is not None:
> >
> > Your comment "if not empty" doesn't appear to match the check here.
> >
> > read_dmi_data may return None, or "" (see _call_dmicode which has a
> return "" for empty fields)
> >
> > serial = ""
> > That returns True when checking if it is 'not None'; I think just:
> >
> > if serial
> >
> > is what we want here instead.
>
> The comment is not right, but the function i think is fine. because
> load_cmdline_data will return False on "". We do want to specifically
>
Why bother checking the command line for a serial of "" ? That's not going
to do anything productive AFAICT. Surely not calling a function with it
isn't needed
is better than calling it when we know ahead of time that it's not a valid
serial number
we can expect on the command line.
Ryan
- 9c021fd... by Vladimir Pouzanov <email address hidden> on 2017-05-20
| Vladimir Pouzanov (farcaller) wrote : | # |
Fixed.
PASSED: Continuous integration, rev:9c021fd4eb2
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
For reference, from the DMTF smbios spec DSP0134_2.7.1, the serial field is a string.
With regard to string length:
http://
NOTE: There is no limit on the length of each individual text string.
However, the length of the entire structure table (including all strings)
must be reported in the Structure Table Length field of the SMBIOS
Structure Table Entry Point which is a WORD field limited to 65,535 bytes.


Vladimir,
This looks really good, thank you.
I'd like to update doc/rtd/ topics/ datasources/ nocloud. rst with an example on how to use this directly with a qemu cmdline.
Also I think the kernel cmdline should override the smbios information.