Comment 14 for bug 1735839

Dmitrii Shcherbakov (dmitriis) wrote :

With this change curtin will error out (resulting in failed deployments in MAAS) if a serial or wwn is not specified on a block device. In my case this failure happened on a VM created manually via virsh (not pods) with block devices that do not have explicit serial or wwn values:

        Running command ['blkid', '-o', 'export', '/dev/vda'] with allowed return codes [0, 2] (capture=True)
        Running command ['udevadm', 'info', '--query=property', '/dev/vda'] with allowed return codes [0] (capture=True)
        An error occured handling 'vda': RuntimeError - Cannot create disk tag udev rule for /dev/vda [id=vda], missing 'serial' or 'wwn' value
        finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: configuring disk: vda
        TIMED BLOCK_META: 4.837
        finish: cmd-install/stage-partitioning/builtin/cmd-block-meta: FAIL: curtin command block-meta
        Traceback (most recent call last):
          File "/curtin/curtin/commands/main.py", line 201, in main
            ret = args.func(args)
          File "/curtin/curtin/log.py", line 97, in wrapper
            return log_time("TIMED %s: " % msg, func, *args, **kwargs)
          File "/curtin/curtin/log.py", line 79, in log_time
            return func(*args, **kwargs)
          File "/curtin/curtin/commands/block_meta.py", line 83, in block_meta
            return meta_custom(args)
          File "/curtin/curtin/commands/block_meta.py", line 1601, in meta_custom
            handler(command, storage_config_dict)
          File "/curtin/curtin/commands/block_meta.py", line 506, in disk_handler
            make_dname(info.get('id'), storage_config)
          File "/curtin/curtin/commands/block_meta.py", line 271, in make_dname
            byid = make_dname_byid(path, error_msg="id=%s" % vol.get('id'))
          File "/curtin/curtin/commands/block_meta.py", line 250, in make_dname_byid
            "missing 'serial' or 'wwn' value" % error_msg)
        RuntimeError: Cannot create disk tag udev rule for /dev/vda [id=vda], missing 'serial' or 'wwn' value
        Cannot create disk tag udev rule for /dev/vda [id=vda], missing 'serial' or 'wwn' value

Stderr: ''

After adding serial numbers curtin still uses the old by-id value (supplied by maas from the db) to try and lookup a device by serial so a recommissioning is needed after serial values are updated:

          File "/curtin/curtin/block/__init__.py", line 686, in lookup_disk
            raise ValueError("no disk with serial '%s' found" % serial_udev)
        ValueError: no disk with serial 'drive-scsi0-0-0-1' found
        no disk with serial 'drive-scsi0-0-0-1' found

Adding serial to VMs created via virsh pods was fixed in maas for 2.5:
https://bugs.launchpad.net/maas/+bug/1785755

I think we may break previous MAAS versions though.