Merge ~mwhudson/curtin:only-eckd-dasds-extract_storage_config into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 16e53edfee1818f1fb574e660e19d1a971be5cd2
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:only-eckd-dasds-extract_storage_config
Merge into: curtin:master
Diff against target: 127 lines (+57/-13)
3 files modified
curtin/storage_config.py (+2/-0)
doc/topics/storage.rst (+19/-11)
tests/unittests/test_storage_config.py (+36/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
Paride Legovini Approve
Review via email: mp+394224@code.launchpad.net

Commit message

storage_config: only produce type: dasd actions for ECKD dasds

this also attempts to improve the dasd documentation a bit

Description of the change

This depends on https://github.com/canonical/probert/pull/101 to do anything interesting so let's not merge this until that is approved.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ryan Harper (raharper) :
review: Needs Fixing
16e53ed... by Michael Hudson-Doyle

my probert branch emits type on dasds not dasd_type

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Thanks for catching my thinko with the key name.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paride Legovini (paride) wrote :

LGTM

review: Approve
Revision history for this message
Ryan Harper (raharper) wrote :

Sorry for the delay, this looks good now.

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Paride Legovini (paride) wrote :
Download full text (3.6 KiB)

amd64 failure:

py3-pylint runtests: commands[0] | /jenkins/servers/server/workspace/curtin-autoland-test/nodes/metal-amd64/curtin/.tox/py3-pylint/bin/python -m pylint --errors-only curtin tests/vmtests
************* Module curtin.commands.install_grub
curtin/commands/install_grub.py:88:19: E1101: Instance of 'Distros' has no 'debian' member (no-member)
curtin/commands/install_grub.py:150:28: E1101: Instance of 'Distros' has no 'redhat' member (no-member)
curtin/commands/install_grub.py:235:28: E1101: Instance of 'Distros' has no 'debian' member (no-member)
curtin/commands/install_grub.py:239:30: E1101: Instance of 'Distros' has no 'redhat' member (no-member)
[...]

This happens from time to time, not what causes it to be flaky.

The arm64 failure is the the hung kernel (watchdog) in action:

======================================================================
ERROR: test suite for <class 'vmtests.test_basic.FocalTestScsiBasic'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/plugins/multiprocess.py", line 788, in run
    self.setUp()
  File "/usr/lib/python3/dist-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  File "/usr/lib/python3/dist-packages/nose/plugins/multiprocess.py", line 770, in setupContext
    super(NoSharedFixtureContextSuite, self).setupContext(context)
  File "/usr/lib/python3/dist-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/usr/lib/python3/dist-packages/nose/util.py", line 471, in try_run
    return func()
  File "/jenkins/servers/server/workspace/curtin-autoland-test/nodes/metal-ppc64el/curtin/tests/vmtests/__init__.py", line 1308, in setUpClass
    '\n'.join(errors))
Exception: FocalTestScsiBasic:Errors during curtin installeripconfig: BOOTIF: SIOCGIFINDEX: No such device
ipconfig: no devices to configure
no search or nameservers found in /run/net-BOOTIF.conf /run/net-*.conf /run/net6-*.conf
[ 242.655062] INFO: task kworker/u4:0:7 blocked for more than 120 seconds.
[ 242.655211] Not tainted 5.4.0-48-generic #52-Ubuntu
[ 242.655258] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 242.656187] [c00000007e4b7db0] [c000000000172e24] kthread+0x1a4/0x1b0
[ 242.656247] [c00000007e4b7e20] [c00000000000b648] ret_from_kernel_thread+0x5c/0x74
[ 242.656326] INFO: task kworker/u4:1:86 blocked for more than 120 seconds.
[ 242.656385] Not tainted 5.4.0-48-generic #52-Ubuntu
[ 242.656431] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 242.657413] [c00000007eb07db0] [c000000000172e24] kthread+0x1a4/0x1b0
[ 242.657472] [c00000007eb07e20] [c00000000000b648] ret_from_kernel_thread+0x5c/0x74
[ 242.657545] INFO: task systemd-udevd:141 blocked for more than 120 seconds.
[ 242.657603] Not tainted 5.4.0-48-generic #52-Ubuntu
[ 242.657650] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 242.658266] [c00000007e57bd00] [c00000000022d208] __do_sys_finit_module+0xc8/0x150
[ 242.658337] [c00000007e57be20] [c00000000000b278] system_call+0x5c/0x68
[ 242.658398] INF...

Read more...

Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/storage_config.py b/curtin/storage_config.py
2index 494b142..a47aa23 100644
3--- a/curtin/storage_config.py
4+++ b/curtin/storage_config.py
5@@ -981,6 +981,8 @@ class DasdParser(ProbertParser):
6 probe_data_key = 'dasd'
7
8 def asdict(self, dasd_config):
9+ if dasd_config.get("type", "ECKD") != "ECKD":
10+ return None
11 dasd_name = os.path.basename(dasd_config['name'])
12 device_id = dasd_config['device_id']
13 blocksize = dasd_config['blocksize']
14diff --git a/doc/topics/storage.rst b/doc/topics/storage.rst
15index ebcf8a4..75c5537 100644
16--- a/doc/topics/storage.rst
17+++ b/doc/topics/storage.rst
18@@ -55,14 +55,21 @@ commands include:
19
20 Dasd Command
21 ~~~~~~~~~~~~
22-The ``dasd`` command sets up a s390x system DASD device for use by curtin.
23-DASD devices require several parameters to configure the low-level structure
24-of the block device. Curtin will examine the configuration and determine if
25-the specified DASD matches the configuration. If the device does not match
26-the configuration Curtin will perform a format of the device to achieve the
27-required configuration. Once a DASD device has been formatted it may be used
28-like regular Linux block devices and can be partitioned (with limitations)
29-with Curtin's ``disk`` command. The ``dasd`` command may contain the following
30+
31+The ``dasd`` command sets up an ECKD s390x system DASD device for use
32+by curtin. FBA DASD devices do not require this low level set
33+up. ECKD DASD drives can also be passed via virtio to KVM virtual
34+machines and in this case this set up must be done on the host prior
35+to starting the virtual machine.
36+
37+DASD devices require several parameters to configure the low-level
38+structure of the block device. Curtin will examine the configuration
39+and determine if the specified DASD matches the configuration. If the
40+device does not match the configuration Curtin will perform a format
41+of the device to achieve the required configuration. Once a DASD
42+device has been formatted it may be used like regular Linux block
43+devices and can be partitioned (with limitations) with Curtin's
44+``disk`` command. The ``dasd`` command may contain the following
45 keys:
46
47 **device_id**: *<ccw bus_id: X.Y.ZZZZ>*
48@@ -138,11 +145,12 @@ The disk command sets up disks for use by curtin. It can wipe the disks, create
49 partition tables, or just verify that the disks exist with an existing partition
50 table. A disk command may contain all or some of the following keys:
51
52-**ptable**: *msdos, gpt*
53+**ptable**: *msdos, gpt, vtoc*
54
55 If the ``ptable`` key is present and a curtin will create an empty
56-partition table of that type on the disk. Curtin supports msdos and
57-gpt partition tables.
58+partition table of that type on the disk. On almost all drives,
59+curtin supports msdos and gpt partition tables; ECKD DASD drives on
60+s390x mainframes can only use the "vtoc" partition table.
61
62 **serial**: *<serial number>*
63
64diff --git a/tests/unittests/test_storage_config.py b/tests/unittests/test_storage_config.py
65index a38f9cd..2d27d4e 100644
66--- a/tests/unittests/test_storage_config.py
67+++ b/tests/unittests/test_storage_config.py
68@@ -783,7 +783,6 @@ class TestDasdParser(CiTestCase):
69
70 def test_dasd_asdict(self):
71 """ DasdParser converts known dasd_data to expected dict. """
72- devname = "/dev/dasda"
73 expected_dict = {
74 'type': 'dasd',
75 'id': 'dasd-dasda',
76@@ -792,9 +791,35 @@ class TestDasdParser(CiTestCase):
77 'mode': 'quick',
78 'disk_layout': 'cdl',
79 }
80- dasd_data = self.dasd.class_data[devname]
81+ dasd_data = self.dasd.class_data["/dev/dasda"]
82 self.assertDictEqual(expected_dict, self.dasd.asdict(dasd_data))
83
84+ def test_dasd_includes_ECKD(self):
85+ """ DasdParser converts known dasd_data to expected dict. """
86+ expected_dict = {
87+ 'type': 'dasd',
88+ 'id': 'dasd-dasda',
89+ 'device_id': '0.0.1522',
90+ 'blocksize': 4096,
91+ 'mode': 'quick',
92+ 'disk_layout': 'cdl',
93+ }
94+ dasd_data = self.dasd.class_data["/dev/dasda"]
95+ dasd_data['type'] = "ECKD"
96+ self.assertDictEqual(expected_dict, self.dasd.asdict(dasd_data))
97+
98+ def test_dasd_skips_FBA(self):
99+ """ DasdParser skips FBA dasds. """
100+ dasd_data = self.dasd.class_data["/dev/dasda"]
101+ dasd_data['type'] = "FBA"
102+ self.assertIsNone(self.dasd.asdict(dasd_data))
103+
104+ def test_dasd_skips_virt(self):
105+ """ DasdParser skips virt dasds. """
106+ dasd_data = self.dasd.class_data["/dev/dasda"]
107+ dasd_data['type'] = "virt"
108+ self.assertIsNone(self.dasd.asdict(dasd_data))
109+
110 @skipUnlessJsonSchema()
111 def test_dasd_parser_parses_all_dasd_devs(self):
112 """ DasdParser returns expected dicts for known dasd probe data."""
113@@ -802,6 +827,15 @@ class TestDasdParser(CiTestCase):
114 self.assertEqual(5, len(configs))
115 self.assertEqual(0, len(errors))
116
117+ @skipUnlessJsonSchema()
118+ def test_dasd_parser_skips_virt_FBA(self):
119+ """ DasdParser returns expected dicts for known dasd probe data."""
120+ self.dasd.class_data["/dev/dasda"]['type'] = "FBA"
121+ self.dasd.class_data["/dev/dasdb"]['type'] = "virt"
122+ configs, errors = self.dasd.parse()
123+ self.assertEqual(3, len(configs))
124+ self.assertEqual(0, len(errors))
125+
126
127 class TestDmCryptParser(CiTestCase):
128

Subscribers

People subscribed via source and target branches