Merge ~mwhudson/curtin:disk_handler-empty-vtoc into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 8d535e1368d3035539c81368556c777db0723bd6
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:disk_handler-empty-vtoc
Merge into: curtin:master
Diff against target: 35 lines (+12/-2)
2 files modified
curtin/commands/block_meta.py (+1/-2)
tests/unittests/test_commands_block_meta.py (+11/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Dimitri John Ledkov (community) Approve
curtin developers Pending
Review via email: mp+394153@code.launchpad.net

Commit message

create an empty vtoc in disk_handler

Another merge proposal I have uses fdasd to get the block and track size
when partitioning a disk. But the wiping disk_handler can do can do
enough damage to stop fdasd working at all. Putting an empty vtoc onto
the disk allows fdasd to report the sizes when needed.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:8d535e1368d3035539c81368556c777db0723bd6

No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want jenkins to rebuild you need to trigger it yourself):
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/394153/+edit-commit-message

https://jenkins.ubuntu.com/server/job/curtin-ci/11/
Executed test runs:
    SUCCESS: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-amd64/11/
    SUCCESS: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-arm64/11/
    SUCCESS: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-ppc64el/11/
    SUCCESS: https://jenkins.ubuntu.com/server/job/curtin-ci/nodes=metal-s390x/11/

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/curtin-ci/11//rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

normally no dasd drives ever are without a vtoc. However, one can try very hard to destory them, or actually come up for the first time in the z/vm environment. In such cases, it's near impossible to operate on the dasd in any sensible manner, thus creating vtoc is the only right way forward. After doing that, it becomes much easier to add/remove partitions or wipe the device (in cutin terms).

review: Approve
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
diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
index eada650..874ccbb 100644
--- a/curtin/commands/block_meta.py
+++ b/curtin/commands/block_meta.py
@@ -611,8 +611,7 @@ def disk_handler(info, storage_config):
611 elif ptable in _dos_names:611 elif ptable in _dos_names:
612 util.subp(["parted", disk, "--script", "mklabel", "msdos"])612 util.subp(["parted", disk, "--script", "mklabel", "msdos"])
613 elif ptable == "vtoc":613 elif ptable == "vtoc":
614 # ignore dasd partition tables614 util.subp(["fdasd", "-c", "/dev/null", disk])
615 pass
616 holders = clear_holders.get_holders(disk)615 holders = clear_holders.get_holders(disk)
617 if len(holders) > 0:616 if len(holders) > 0:
618 LOG.info('Detected block holders on disk %s: %s', disk, holders)617 LOG.info('Detected block holders on disk %s: %s', disk, holders)
diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
index 98be573..ffec434 100644
--- a/tests/unittests/test_commands_block_meta.py
+++ b/tests/unittests/test_commands_block_meta.py
@@ -1294,6 +1294,17 @@ class TestDiskHandler(CiTestCase):
1294 m_getpath.assert_called_with(info['id'], storage_config)1294 m_getpath.assert_called_with(info['id'], storage_config)
1295 m_block.get_part_table_type.assert_called_with(disk_path)1295 m_block.get_part_table_type.assert_called_with(disk_path)
12961296
1297 @patch('curtin.commands.block_meta.util.subp')
1298 @patch('curtin.commands.block_meta.clear_holders.get_holders')
1299 @patch('curtin.commands.block_meta.get_path_to_storage_volume')
1300 def test_disk_handler_calls_fdasd_for_vtoc(self, m_getpath,
1301 m_get_holders, m_subp):
1302 info = {'ptable': 'vtoc', 'type': 'disk', 'id': 'disk-foobar'}
1303 path = m_getpath.return_value = self.random_string()
1304 m_get_holders.return_value = []
1305 block_meta.disk_handler(info, OrderedDict())
1306 m_subp.assert_called_once_with(['fdasd', '-c', '/dev/null', path])
1307
12971308
1298class TestLvmVolgroupHandler(CiTestCase):1309class TestLvmVolgroupHandler(CiTestCase):
12991310

Subscribers

People subscribed via source and target branches