Need help to deploy Windows 11 custom image

Hi,

I’m trying to deploy a Windows 11 Pro custom image built with Packer on a Lenovo ThinkCentre M70q Gen3 with MAAS 3.2 UI. I use Intel AMT for power control.

The error happens at the chroot and cloud-init phase. You can see below the error stack trace in the install.log file:

    curtin: Installation failed with exception: Unexpected error while running command.
    Command: ['curtin', 'in-target', '--', 'bash', '-c', 'dpkg-query -s cloud-init || (echo "cloud-init not detected, MAAS will not be able to configure this machine properly" && exit 1)']
    Exit code: 127
    Reason: -
    Stdout: start: cmd-install/stage-late/98-validate-custom-image-has-cloud-init/cmd-in-target: curtin command in-target
            Running command ['mount', '--bind', '/dev', '/tmp/tmprft4h_es/target/dev'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--bind', '/proc', '/tmp/tmprft4h_es/target/proc'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--bind', '/run', '/tmp/tmprft4h_es/target/run'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--bind', '/sys', '/tmp/tmprft4h_es/target/sys'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--bind', '/sys/firmware/efi/efivars', '/tmp/tmprft4h_es/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
            Running command ['unshare', '--help'] with allowed return codes [0] (capture=True)
            Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmprft4h_es/target', 'bash', '-c', 'dpkg-query -s cloud-init || (echo "cloud-init not detected, MAAS will not be able to configure this machine properly" && exit 1)'] with allowed return codes [0] (capture=False)
            chroot: failed to run command ‘bash’: No such file or directory
            Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
            TIMED subp(['udevadm', 'settle']): 0.017
            Running command ['mount', '--make-private', '/tmp/tmprft4h_es/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
            Running command ['umount', '/tmp/tmprft4h_es/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--make-private', '/tmp/tmprft4h_es/target/sys'] with allowed return codes [0] (capture=False)
            Running command ['umount', '/tmp/tmprft4h_es/target/sys'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--make-private', '/tmp/tmprft4h_es/target/run'] with allowed return codes [0] (capture=False)
            Running command ['umount', '/tmp/tmprft4h_es/target/run'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--make-private', '/tmp/tmprft4h_es/target/proc'] with allowed return codes [0] (capture=False)
            Running command ['umount', '/tmp/tmprft4h_es/target/proc'] with allowed return codes [0] (capture=False)
            Running command ['mount', '--make-private', '/tmp/tmprft4h_es/target/dev'] with allowed return codes [0] (capture=False)
            Running command ['umount', '/tmp/tmprft4h_es/target/dev'] with allowed return codes [0] (capture=False)
            finish: cmd-install/stage-late/98-validate-custom-image-has-cloud-init/cmd-in-target: FAIL: curtin command in-target
            
    Stderr: ''

Please see attached the full logs (EDIT: it haven’t found a way to attach file).

Any help would be very much appreciated.

Tiav

Please also see below a screenshot of the event logs.

I think I’m doing some progress…

The first failure happened when I have uploaded the image with the command below:
maas admin boot-resources create name='custom/windows11-v3' title='Windows 11 Pro TGZ v3' architecture='amd64/generic' filetype='tgz' content@=windows_11-v3.tgz

After that, I have uploaded the image by just replacing custom by windows in the name (as suggested here):
maas admin boot-resources create name='windows/windows11-v3' title='Windows 11 Pro TGZ v3' architecture='amd64/generic' filetype='tgz' content@=windows_11-v3.tgz

This leads to another error:

Did not find any filesystem on ['nvme0n1'] that contained one of ['curtin', 'system-data/var/lib/snapd', 'snaps']
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'block-meta', 'custom']
Exit code: 3
Reason: -
Stdout: start: cmd-install/stage-partitioning/builtin/cmd-block-meta: curtin command block-meta
        get_path_to_storage_volume for volume nvme0n1({'grub_device': True, 'id': 'nvme0n1', 'model': 'WD PC SN740 SDDQNQD-512G-1001', 'name': 'nvme0n1', 'ptable': 'gpt', 'serial': '22164L801264', 'type': 'disk', 'wipe': 'superblock'})
        Processing serial 22164L801264 via udev to 22164L801264
        lookup_disks found: ['nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264', 'nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264-part1', 'nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264-part2']
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device member? False
        block.lookup_disk() returning path /dev/nvme0n1
        Running command ['partprobe', '/dev/nvme0n1'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.127
        devsync happy - path /dev/nvme0n1 now exists
        return volume path /dev/nvme0n1
        get_path_to_storage_volume for volume nvme0n1-part1({'device': 'nvme0n1', 'flag': 'boot', 'id': 'nvme0n1-part1', 'name': 'nvme0n1-part1', 'number': 1, 'offset': '4194304B', 'size': '536870912B', 'type': 'partition', 'uuid': '5d4263ef-b3e5-4de7-b99e-640e158b74e7', 'wipe': 'superblock'})
        get_path_to_storage_volume for volume nvme0n1({'grub_device': True, 'id': 'nvme0n1', 'model': 'WD PC SN740 SDDQNQD-512G-1001', 'name': 'nvme0n1', 'ptable': 'gpt', 'serial': '22164L801264', 'type': 'disk', 'wipe': 'superblock'})
        Processing serial 22164L801264 via udev to 22164L801264
        lookup_disks found: ['nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264', 'nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264-part2', 'nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264-part1']
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device member? False
        block.lookup_disk() returning path /dev/nvme0n1
        Running command ['partprobe', '/dev/nvme0n1'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.135
        devsync happy - path /dev/nvme0n1 now exists
        return volume path /dev/nvme0n1
        Running command ['partprobe', '/dev/nvme0n1'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.131
        devsync happy - path /dev/nvme0n1 now exists
        return volume path /dev/nvme0n1p1
        get_path_to_storage_volume for volume nvme0n1-part2({'device': 'nvme0n1', 'id': 'nvme0n1-part2', 'name': 'nvme0n1-part2', 'number': 2, 'size': '511566675968B', 'type': 'partition', 'uuid': '43486267-8856-43e9-a25b-e33360bb842a', 'wipe': 'superblock'})
        get_path_to_storage_volume for volume nvme0n1({'grub_device': True, 'id': 'nvme0n1', 'model': 'WD PC SN740 SDDQNQD-512G-1001', 'name': 'nvme0n1', 'ptable': 'gpt', 'serial': '22164L801264', 'type': 'disk', 'wipe': 'superblock'})
        Processing serial 22164L801264 via udev to 22164L801264
        lookup_disks found: ['nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264', 'nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264-part1', 'nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264-part2']
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device member? False
        block.lookup_disk() returning path /dev/nvme0n1
        Running command ['partprobe', '/dev/nvme0n1'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.122
        devsync happy - path /dev/nvme0n1 now exists
        return volume path /dev/nvme0n1
        Running command ['partprobe', '/dev/nvme0n1'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.131
        devsync happy - path /dev/nvme0n1 now exists
        return volume path /dev/nvme0n1p2
        block-meta: extracted devices to clear: ['/dev/nvme0n1', '/dev/nvme0n1p1', '/dev/nvme0n1p2']
        Declared block devices: ['/dev/nvme0n1', '/dev/nvme0n1p1', '/dev/nvme0n1p2']
        clearing devices=['/dev/nvme0n1', '/dev/nvme0n1p1', '/dev/nvme0n1p2']
        start: cmd-install/stage-partitioning/builtin/cmd-block-meta/clear-holders: removing previous storage devices
        Running command ['mdadm', '--assemble', '--scan', '-v'] with allowed return codes [0, 1, 2] (capture=True)
        mdadm assemble scan results:
        
        mdadm: looking for devices for further assembly
        mdadm: no recogniseable superblock on /dev/nvme0n1p2
        mdadm: Cannot assemble mbr metadata on /dev/nvme0n1p1
        mdadm: Cannot assemble mbr metadata on /dev/nvme0n1
        mdadm: no recogniseable superblock on /dev/loop3
        mdadm: no recogniseable superblock on /dev/loop2
        mdadm: no recogniseable superblock on /dev/loop1
        mdadm: no recogniseable superblock on /dev/loop0
        mdadm: No arrays found in config file or automatically
        
        Running command ['mdadm', '--detail', '--scan', '-v'] with allowed return codes [0, 1] (capture=True)
        mdadm detail scan after assemble:
        
        
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.010
        Detected multipath support, reload maps
        Running command ['multipath', '-r'] with allowed return codes [0] (capture=False)
        Verifying /dev/mapper/mpath* files are symlinks
        Running command ['dmsetup', 'ls', '-o', 'blkdevname'] with allowed return codes [0] (capture=True)
        Running command ['pvscan', '--config', 'devices{ filter = [ "a|/dev/mapper/mpath.*|", "a|/dev/mapper/dm_crypt-.*|", "r|.*|" ] }'] with allowed return codes [0] (capture=True)
        Running command ['vgscan', '--config', 'devices{ filter = [ "a|/dev/mapper/mpath.*|", "a|/dev/mapper/dm_crypt-.*|", "r|.*|" ] }'] with allowed return codes [0] (capture=True)
        Running command ['vgchange', '--activate=y', '--config', 'devices{ filter = [ "a|/dev/mapper/mpath.*|", "a|/dev/mapper/dm_crypt-.*|", "r|.*|" ] }'] with allowed return codes [0] (capture=True)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.021
        Loading kernel module bcache via modprobe
        Running command ['modprobe', '--use-blacklist', 'bcache'] with allowed return codes [0] (capture=False)
        Generating device storage trees for path(s): ['/dev/nvme0n1', '/dev/nvme0n1p1', '/dev/nvme0n1p2']
        devname '/sys/class/block/nvme0n1' had holders: []
        /dev/nvme0n1 is multipath device partition? False
        /dev/nvme0n1 is multipath device partition? False
        /dev/nvme0n1 is multipath device partition? False
        devname '/sys/class/block/nvme0n1p1' had holders: []
        devname '/sys/class/block/nvme0n1p2' had holders: []
        devname '/sys/class/block/nvme0n1p1' had holders: []
        devname '/sys/class/block/nvme0n1p2' had holders: []
        Current device storage tree:
        nvme0n1
        |-- nvme0n1p1
        `-- nvme0n1p2
        nvme0n1p1
        nvme0n1p2
        Shutdown Plan:
        {'level': 3, 'device': '/sys/class/block/nvme0n1p1', 'dev_type': 'partition'}
        {'level': 3, 'device': '/sys/class/block/nvme0n1p2', 'dev_type': 'partition'}
        {'level': 1, 'device': '/sys/class/block/nvme0n1', 'dev_type': 'disk'}
        shutdown running on holder type: 'partition' syspath: '/sys/class/block/nvme0n1p1'
        Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        get_blockdev_sector_size: info:
        {
         "nvme0n1": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "",
          "GROUP": "disk",
          "KNAME": "nvme0n1",
          "LABEL": "",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:0",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "WD PC SN740 SDDQNQD-512G-1001",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "512110190592",
          "STATE": "live",
          "TYPE": "disk",
          "UUID": "",
          "device_path": "/dev/nvme0n1"
         },
         "nvme0n1p1": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "vfat",
          "GROUP": "disk",
          "KNAME": "nvme0n1p1",
          "LABEL": "efi",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:3",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1p1",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "536870912",
          "STATE": "",
          "TYPE": "part",
          "UUID": "EEA7-4050",
          "device_path": "/dev/nvme0n1p1"
         },
         "nvme0n1p2": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "ext4",
          "GROUP": "disk",
          "KNAME": "nvme0n1p2",
          "LABEL": "root",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:4",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1p2",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "511566675968",
          "STATE": "",
          "TYPE": "part",
          "UUID": "35dbf2fe-9a6b-43c4-82a4-abf5ff369d17",
          "device_path": "/dev/nvme0n1p2"
         }
        }
        get_blockdev_sector_size: (log=512, phys=512)
        Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID'] with allowed return codes [0] (capture=True)
        Checking if /dev/nvme0n1p1 is a swap device
        Found swap magic: b'\x00\x00\x00\x00\x00\x00\x00\x00U\xaa'
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1p1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1p1 is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1p1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1p1 is multipath device member? False
        wiping superblock on /dev/nvme0n1p1
        wiping /dev/nvme0n1p1 attempt 1/4
        wiping 1M on /dev/nvme0n1p1 at offsets [0, -1048576]
        successfully wiped device /dev/nvme0n1p1 on attempt 1/4
        shutdown running on holder type: 'partition' syspath: '/sys/class/block/nvme0n1p2'
        Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        get_blockdev_sector_size: info:
        {
         "nvme0n1": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "",
          "GROUP": "disk",
          "KNAME": "nvme0n1",
          "LABEL": "",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:0",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "WD PC SN740 SDDQNQD-512G-1001",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "512110190592",
          "STATE": "live",
          "TYPE": "disk",
          "UUID": "",
          "device_path": "/dev/nvme0n1"
         },
         "nvme0n1p1": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "vfat",
          "GROUP": "disk",
          "KNAME": "nvme0n1p1",
          "LABEL": "efi",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:3",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1p1",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "536870912",
          "STATE": "",
          "TYPE": "part",
          "UUID": "EEA7-4050",
          "device_path": "/dev/nvme0n1p1"
         },
         "nvme0n1p2": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "ext4",
          "GROUP": "disk",
          "KNAME": "nvme0n1p2",
          "LABEL": "root",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:4",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1p2",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "511566675968",
          "STATE": "",
          "TYPE": "part",
          "UUID": "35dbf2fe-9a6b-43c4-82a4-abf5ff369d17",
          "device_path": "/dev/nvme0n1p2"
         }
        }
        get_blockdev_sector_size: (log=512, phys=512)
        Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID'] with allowed return codes [0] (capture=True)
        Checking if /dev/nvme0n1p2 is a swap device
        Found swap magic: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1p2'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1p2 is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1p2'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1p2 is multipath device member? False
        wiping superblock on /dev/nvme0n1p2
        wiping /dev/nvme0n1p2 attempt 1/4
        wiping 1M on /dev/nvme0n1p2 at offsets [0, -1048576]
        successfully wiped device /dev/nvme0n1p2 on attempt 1/4
        shutdown running on holder type: 'disk' syspath: '/sys/class/block/nvme0n1'
        Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        get_blockdev_sector_size: info:
        {
         "nvme0n1": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "",
          "GROUP": "disk",
          "KNAME": "nvme0n1",
          "LABEL": "",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:0",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "WD PC SN740 SDDQNQD-512G-1001",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "512110190592",
          "STATE": "live",
          "TYPE": "disk",
          "UUID": "",
          "device_path": "/dev/nvme0n1"
         },
         "nvme0n1p1": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "",
          "GROUP": "disk",
          "KNAME": "nvme0n1p1",
          "LABEL": "",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:3",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1p1",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "536870912",
          "STATE": "",
          "TYPE": "part",
          "UUID": "",
          "device_path": "/dev/nvme0n1p1"
         },
         "nvme0n1p2": {
          "ALIGNMENT": "0",
          "DISC-ALN": "0",
          "DISC-GRAN": "512",
          "DISC-MAX": "2199023255040",
          "DISC-ZERO": "0",
          "FSTYPE": "ext4",
          "GROUP": "disk",
          "KNAME": "nvme0n1p2",
          "LABEL": "root",
          "LOG-SEC": "512",
          "MAJ:MIN": "259:4",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "",
          "MOUNTPOINT": "",
          "NAME": "nvme0n1p2",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "0",
          "RQ-SIZE": "1023",
          "SIZE": "511566675968",
          "STATE": "",
          "TYPE": "part",
          "UUID": "35dbf2fe-9a6b-43c4-82a4-abf5ff369d17",
          "device_path": "/dev/nvme0n1p2"
         }
        }
        get_blockdev_sector_size: (log=512, phys=512)
        Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID'] with allowed return codes [0] (capture=True)
        Checking if /dev/nvme0n1 is a swap device
        Found swap magic: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device member? False
        wiping superblock on /dev/nvme0n1
        wiping /dev/nvme0n1 attempt 1/4
        wiping 1M on /dev/nvme0n1 at offsets [0, -1048576]
        successfully wiped device /dev/nvme0n1 on attempt 1/4
        /sys/class/block/nvme0n1 had partitions, issuing partition reread
        Running command ['blockdev', '--rereadpt', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.028
        block.sys_block_path: devname /dev/nvme0n1p1 does not exist
        block.sys_block_path: devname /dev/nvme0n1p2 does not exist
        devname '/sys/class/block/nvme0n1' had holders: []
        /dev/nvme0n1 is multipath device partition? False
        /dev/nvme0n1 is multipath device partition? False
        /dev/nvme0n1 is multipath device partition? False
        finish: cmd-install/stage-partitioning/builtin/cmd-block-meta/clear-holders: SUCCESS: removing previous storage devices
        blockmeta: detected dd-images, using mode=simple
        Processing serial 22164L801264 via udev to 22164L801264
        lookup_disks found: ['nvme-WD_PC_SN740_SDDQNQD-512G-1001_22164L801264']
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        /dev/nvme0n1 is multipath device member? False
        block.lookup_disk() returning path /dev/nvme0n1
        Running command ['/usr/sbin/multipath', '-F'] with allowed return codes [0, 1] (capture=False)
        installing in 'custom' mode to 'nvme0n1'
        writing image to disk {'type': 'dd-tgz', 'uri': 'http://172.16.37.117:5248/images/windows/amd64/generic/windows11-v3/uploaded/root-dd'}, nvme0n1
        Running command ['sh', '-c', 'wget "$1" --progress=dot:mega -O - |tar -xOzf -| dd bs=4M of="$2"', '--', 'http://172.16.37.117:5248/images/windows/amd64/generic/windows11-v3/uploaded/root-dd', '/dev/nvme0n1'] with allowed return codes [0] (capture=False)
        --2023-03-08 16:41:33--  http://172.16.37.117:5248/images/windows/amd64/generic/windows11-v3/uploaded/root-dd
        Connecting to 172.16.37.117:5248... connected.
        HTTP request sent, awaiting response... 404 Not Found
        2023-03-08 16:41:41 ERROR 404: Not Found.
        
        
        gzip: stdin: unexpected end of file
        tar: Child returned status 1
        tar: Error is not recoverable: exiting now
        0+0 records in
        0+0 records out
        0 bytes copied, 8.13111 s, 0.0 kB/s
        Running command ['partprobe', '/dev/nvme0n1'] with allowed return codes [0] (capture=False)
        Running command ['udevadm', 'trigger', '/dev/nvme0n1'] with allowed return codes [0] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.068
        Running command ['vgchange', '--activate=y'] with allowed return codes [0] (capture=True)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.019
        Searching for filesystem on ['nvme0n1'] containing one of: ['curtin', 'system-data/var/lib/snapd', 'snaps']
        Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID', '/dev/nvme0n1'] with allowed return codes [0] (capture=True)
        TIMED BLOCK_META: 9.690
        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 202, 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 113, in block_meta
            return meta_simple(args)
          File "/curtin/curtin/commands/block_meta.py", line 2164, in meta_simple
            rootdev = write_image_to_disk(dd_images[0], devname)
          File "/curtin/curtin/commands/block_meta.py", line 171, in write_image_to_disk
            return block.get_root_device([devname], paths=paths)
          File "/curtin/curtin/block/__init__.py", line 760, in get_root_device
            raise ValueError(
        ValueError: Did not find any filesystem on ['nvme0n1'] that contained one of ['curtin', 'system-data/var/lib/snapd', 'snaps']
        Did not find any filesystem on ['nvme0n1'] that contained one of ['curtin', 'system-data/var/lib/snapd', 'snaps']
        
Stderr: ''

Next, I will try to convert my QCOW2 image to RAW, gzip it and import it as filetype=ddgz and see what happens.

nice progress, @tandrez! keep typing! :slight_smile:

Hi again,

After some time and many trials and issues, I was finally able to make it work!

Long story short, here are the main things that I have done:

  • When importing the image in MAAS, the name must begin with windows\ and, in my case, the filetype has to be ddgz because it is a gzip compressed raw image (it will NOT work if you “tar.gz” the image). Thus, the command should look like this:
    maas admin boot-resources create name='windows/windows11' title='Windows 11' architecture='amd64/generic' filetype='ddgz' content@=windows11-raw.gz
  • I have installed curtin hooks and cloudbase-init in the image
  • I have converted my image to UEFI boot mode (because the target machine is in this mode)

Now, I have one issue remaining: at the end of the deployment process, the machine reboots and I can log successfully in Windows, there are no errors in the log, but the machine state hangs on “Deploying” and changes to “Failed deployment” after a timeout. Any idea?

1 Like

Hello,

I’m still trying to resolve the problem of “Failed deployment” after the 30 min timeout.

Please find below the cloudbase-init log files.

cloudbase-init-unattend.log:

2023-05-25 12:47:32.318 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:32.818 3456 DEBUG cloudbaseinit.osutils.windows [-] Checking if service exists: cloudbase-init check_service_exists C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1097
2023-05-25 12:47:32.818 3456 DEBUG cloudbaseinit.osutils.windows [-] Getting service username: cloudbase-init get_service_username C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1230
2023-05-25 12:47:32.818 3456 DEBUG cloudbaseinit.osutils.windows [-] Resetting password for service user: .\cloudbase-init reset_service_password C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1253
2023-05-25 12:47:32.833 3456 DEBUG cloudbaseinit.osutils.windows [-] Setting service credentials: cloudbase-init set_service_credentials C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1213
2023-05-25 12:47:32.849 3456 DEBUG cloudbaseinit.init [-] No need to respawn process. Current user: WINDOWS-2022$. Service user: cloudbase-init _reset_service_password_and_respawn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\init.py:137
2023-05-25 12:47:32.865 3456 INFO cloudbaseinit.init [-] Cloudbase-Init version: 1.1.4
2023-05-25 12:47:32.865 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.mtu.MTUPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:32.880 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:32.896 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:32.911 3456 INFO cloudbaseinit.init [-] Executing plugins for stage 'PRE_NETWORKING':
2023-05-25 12:47:32.911 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.mtu.MTUPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:32.911 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:32.911 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:32.911 3456 INFO cloudbaseinit.init [-] Executing plugins for stage 'PRE_METADATA_DISCOVERY':
2023-05-25 12:47:32.911 3456 INFO cloudbaseinit.init [-] Executing plugin 'MTUPlugin'
2023-05-25 12:47:32.911 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:42.956 3456 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.maasservice.MaaSHttpService' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:47:43.112 3456 WARNING oslo_config.cfg [-] Deprecated: Option "maas_metadata_url" from group "DEFAULT" is deprecated. Use option "metadata_base_url" from group "maas".
2023-05-25 12:47:43.112 3456 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:47:43.112 3456 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_consumer_key" from group "DEFAULT" is deprecated. Use option "oauth_consumer_key" from group "maas".
2023-05-25 12:47:43.112 3456 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_consumer_secret" from group "DEFAULT" is deprecated. Use option "oauth_consumer_secret" from group "maas".
2023-05-25 12:47:43.112 3456 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_token_key" from group "DEFAULT" is deprecated. Use option "oauth_token_key" from group "maas".
2023-05-25 12:47:43.112 3456 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_token_secret" from group "DEFAULT" is deprecated. Use option "oauth_token_secret" from group "maas".
2023-05-25 12:47:43.112 3456 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:47:43.128 3456 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:47:43.143 3456 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 12:47:47.158 3456 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:47:47.158 3456 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:47:47.158 3456 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:47:47.174 3456 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 12:47:51.189 3456 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:47:51.189 3456 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:47:51.189 3456 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:47:51.204 3456 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
[... X retries]
2023-05-25 12:54:21.925 3456 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:54:21.925 3456 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:54:21.925 3456 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:54:21.941 3456 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 12:54:25.955 3456 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:54:25.955 3456 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:54:25.955 3456 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:54:25.971 3456 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice [-] 401 Client Error: Unauthorized for url: http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice Traceback (most recent call last):
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py", line 80, in load
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     self._get_cache_data('%s/meta-data/' % self._metadata_version)
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 77, in _get_cache_data
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     data = self._exec_with_retry(lambda: self._get_data(path))
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 60, in _exec_with_retry
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     return action()
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 77, in <lambda>
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     data = self._exec_with_retry(lambda: self._get_data(path))
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 325, in _get_data
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     response = self._http_request(path)
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py", line 107, in _http_request
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     return super(MaaSHttpService, self)._http_request(url, data, headers,
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 319, in _http_request
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     response.raise_for_status()
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\requests\models.py", line 1021, in raise_for_status
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice     raise HTTPError(http_error_msg, response=self)
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.metadata.services.maasservice 
2023-05-25 12:54:25.971 3456 DEBUG cloudbaseinit.metadata.services.maasservice [-] Metadata not found at URL 'http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/' load C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:84
2023-05-25 12:54:25.971 3456 ERROR cloudbaseinit.init [-] No metadata service found: cloudbaseinit.exception.MetadataNotFoundException: No available service found
2023-05-25 12:54:25.971 3456 INFO cloudbaseinit.init [-] Plugins execution done

cloudbase-init.log:

2023-05-25 12:56:33.783 4172 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.080 4172 DEBUG cloudbaseinit.osutils.windows [-] Checking if service exists: cloudbase-init check_service_exists C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1097
2023-05-25 12:56:34.080 4172 DEBUG cloudbaseinit.osutils.windows [-] Getting service username: cloudbase-init get_service_username C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1230
2023-05-25 12:56:34.080 4172 DEBUG cloudbaseinit.osutils.windows [-] Resetting password for service user: .\cloudbase-init reset_service_password C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1253
2023-05-25 12:56:34.095 4172 DEBUG cloudbaseinit.osutils.windows [-] Setting service credentials: cloudbase-init set_service_credentials C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1213
2023-05-25 12:56:34.111 4172 INFO cloudbaseinit.init [-] Respawning current process with updated credentials.
2023-05-25 12:56:34.111 4172 DEBUG cloudbaseinit.osutils.windows [-] Creating logon session for user: .\cloudbase-init create_user_logon_session C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:651
2023-05-25 12:56:34.142 4172 DEBUG cloudbaseinit.osutils.windows [-] Executing process as user, command line: ['C:\\Program Files\\Cloudbase Solutions\\Cloudbase-Init\\Python\\Scripts\\cloudbase-init', '--config-file', 'C:\\Program Files\\Cloudbase Solutions\\Cloudbase-Init\\conf\\cloudbase-init.conf', '--noreset_service_password'] execute_process_as_user C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:706
2023-05-25 12:56:34.408 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.439 4396 INFO cloudbaseinit.init [-] Cloudbase-Init version: 1.1.4
2023-05-25 12:56:34.439 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.mtu.MTUPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.454 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.470 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.470 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.createuser.CreateUserPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.486 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.501 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.517 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.533 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.533 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdata.UserDataPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.579 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.845 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.970 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.986 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.986 4396 INFO cloudbaseinit.init [-] Executing plugins for stage 'PRE_NETWORKING':
2023-05-25 12:56:34.986 4396 INFO cloudbaseinit.init [-] Executing plugin 'NTPClientPlugin'
2023-05-25 12:56:34.986 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:34.986 4396 DEBUG cloudbaseinit.osutils.windows [-] Getting service start mode for: w32time get_service_start_mode C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1117
2023-05-25 12:56:35.017 4396 DEBUG cloudbaseinit.osutils.windows [-] Getting service status for: w32time get_service_status C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1107
2023-05-25 12:56:35.017 4396 INFO cloudbaseinit.plugins.common.ntpclient [-] NTP client service enabled
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.plugins.common.ntpclient [-] Could not obtain the NTP configuration via DHCP execute C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\plugins\common\ntpclient.py:71
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.mtu.MTUPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.createuser.CreateUserPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.userdata.UserDataPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 INFO cloudbaseinit.init [-] Executing plugins for stage 'PRE_METADATA_DISCOVERY':
2023-05-25 12:56:45.068 4396 INFO cloudbaseinit.init [-] Executing plugin 'MTUPlugin'
2023-05-25 12:56:45.068 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:45.068 4396 DEBUG urllib3.connectionpool [-] Starting new HTTPS connection (1): www.cloudbase.it:443 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:1003
2023-05-25 12:56:55.094 4396 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.maasservice.MaaSHttpService' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\utils\classloader.py:27
2023-05-25 12:56:55.110 4396 WARNING oslo_config.cfg [-] Deprecated: Option "maas_metadata_url" from group "DEFAULT" is deprecated. Use option "metadata_base_url" from group "maas".
2023-05-25 12:56:55.110 4396 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:56:55.110 4396 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_consumer_key" from group "DEFAULT" is deprecated. Use option "oauth_consumer_key" from group "maas".
2023-05-25 12:56:55.110 4396 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_consumer_secret" from group "DEFAULT" is deprecated. Use option "oauth_consumer_secret" from group "maas".
2023-05-25 12:56:55.110 4396 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_token_key" from group "DEFAULT" is deprecated. Use option "oauth_token_key" from group "maas".
2023-05-25 12:56:55.110 4396 WARNING oslo_config.cfg [-] Deprecated: Option "maas_oauth_token_secret" from group "DEFAULT" is deprecated. Use option "oauth_token_secret" from group "maas".
2023-05-25 12:56:55.110 4396 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:56:55.125 4396 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:56:55.141 4396 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 12:56:59.156 4396 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:56:59.156 4396 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:56:59.156 4396 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:56:59.171 4396 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 12:57:03.186 4396 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 12:57:03.186 4396 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 12:57:03.186 4396 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 12:57:03.202 4396 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 12:57:06.361 4396 DEBUG cloudbaseinit.version [-] Failed checking for new versions: HTTPSConnectionPool(host='www.cloudbase.it', port=443): Max retries exceeded with url: /checkupdates.php?p=Cloudbase-Init&v=1.1.4 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001F8AE668C70>, 'Connection to www.cloudbase.it timed out. (connect timeout=None)')) _check_latest_version C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\version.py:52
[... X retries]
2023-05-25 13:03:33.389 4396 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 13:03:33.389 4396 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 13:03:33.389 4396 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 13:03:33.389 4396 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 13:03:37.400 4396 DEBUG cloudbaseinit.metadata.services.maasservice [-] Getting authorization headers for http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/. _get_oauth_headers C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:89
2023-05-25 13:03:37.400 4396 DEBUG cloudbaseinit.metadata.services.base [-] Executing http request GET at http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ _http_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py:315
2023-05-25 13:03:37.400 4396 DEBUG urllib3.connectionpool [-] Starting new HTTP connection (1): <MAAS_IP_ADDRESS>:5248 _new_conn C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:228
2023-05-25 13:03:37.416 4396 DEBUG urllib3.connectionpool [-] http://<MAAS_IP_ADDRESS>:5248 "GET /MAAS/metadata/2012-03-01/meta-data/ HTTP/1.1" 401 121 _make_request C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\urllib3\connectionpool.py:456
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice [-] 401 Client Error: Unauthorized for url: http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice Traceback (most recent call last):
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py", line 80, in load
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     self._get_cache_data('%s/meta-data/' % self._metadata_version)
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 77, in _get_cache_data
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     data = self._exec_with_retry(lambda: self._get_data(path))
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 60, in _exec_with_retry
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     return action()
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 77, in <lambda>
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     data = self._exec_with_retry(lambda: self._get_data(path))
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 325, in _get_data
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     response = self._http_request(path)
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py", line 107, in _http_request
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     return super(MaaSHttpService, self)._http_request(url, data, headers,
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\base.py", line 319, in _http_request
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     response.raise_for_status()
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice   File "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\requests\models.py", line 1021, in raise_for_status
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice     raise HTTPError(http_error_msg, response=self)
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/
2023-05-25 13:03:37.416 4396 ERROR cloudbaseinit.metadata.services.maasservice 
2023-05-25 13:03:37.432 4396 DEBUG cloudbaseinit.metadata.services.maasservice [-] Metadata not found at URL 'http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/' load C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\metadata\services\maasservice.py:84
2023-05-25 13:03:37.432 4396 ERROR cloudbaseinit.init [-] No metadata service found: cloudbaseinit.exception.MetadataNotFoundException: No available service found
2023-05-25 13:03:37.432 4396 INFO cloudbaseinit.init [-] Plugins execution done
2023-05-25 13:03:37.432 4396 INFO cloudbaseinit.init [-] Stopping Cloudbase-Init service
2023-05-25 13:03:40.441 4396 DEBUG cloudbaseinit.osutils.windows [-] Stopping service cloudbase-init stop_service C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\lib\site-packages\cloudbaseinit\osutils\windows.py:1145

And here are the cloudbase-init config files:

cloudbase-init-unattend.conf

[DEFAULT]
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
debug=true
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
log_file=cloudbase-init-unattend.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
logging_serial_port_settings=
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
check_latest_version=false
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,cloudbaseinit.metadata.services.httpservice.HttpService,cloudbaseinit.metadata.services.ec2service.EC2Service,cloudbaseinit.metadata.services.maasservice.MaaSHttpService
plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin
allow_reboot=false
stop_service_on_exit=false
retry_count=100

metadata_services=cloudbaseinit.metadata.services.maasservice.MaaSHttpService
maas_metadata_url=http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/
maas_oauth_consumer_key=<AUTO_GENERATED>
maas_oauth_consumer_secret=''
maas_oauth_token_key=<AUTO_GENERATED>
maas_oauth_token_secret=<AUTO_GENERATED>

cloudbase-init.conf:

[DEFAULT]
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
debug=true
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
log_file=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
logging_serial_port_settings=
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
check_latest_version=true
retry_count=100

metadata_services=cloudbaseinit.metadata.services.maasservice.MaaSHttpService
maas_metadata_url=http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/
maas_oauth_consumer_key=<AUTO_GENERATED>
maas_oauth_consumer_secret=''
maas_oauth_token_key=<AUTO_GENERATED>
maas_oauth_token_secret=<AUTO_GENERATED>

I have tried to increase the parameter retry_count in case the network needed more time to be ready after reboot but it has not changed anything.

When I access the URL http://<MAAS_IP_ADDRESS>:5248/MAAS/metadata/2012-03-01/meta-data/ with a web browser from the machine, I have no problem (http response code 200).

When I manually execute the service cloudbase-init it works (even though I may need to run the service multiple times before it works).

Thank you for your help.

Hello tandrez,

I hope you’re doing fine !

I am trying to accomplish the same.

Could you point me the documentation you follow about “I have installed curtin hooks and cloudbase-init in the image” ?

Thanks in advance,
Have a nice day,
Best Regards,
Mickaël.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.