cloudbase / windows-imaging-tools

Tools to automate the creation of a Windows image for OpenStack, supporting KVM, Hyper-V, ESXi and more.
Apache License 2.0
685 stars 230 forks source link

The image generated with is not working in MAAS: 3.1.0 #370

Open NgatiaFrankline opened 2 years ago

NgatiaFrankline commented 2 years ago

Am trying to prepare a windows server 2016 STD image for MAAS: 3.1.0 using the script in examples: create-windows-cloud-image.ps1 but it dosen't work. Note the script runs successfully and the upload to maas boot resources is successful too. The machine is commissions by Ubuntu 20.04LTS. What could be wrong. Kindly if you need access to my private maas setup for a workround/reproduce the error please info me, we can arrange. Here are my logs:

Events logs:

Sat, 17 Sep. 2022 15:27:41 | HTTP Request - /images/ubuntu/amd64/ga-20.04/focal/stable/boot-initrd
-- | --
Sat, 17 Sep. 2022 15:27:40 | HTTP Request - /images/ubuntu/amd64/ga-20.04/focal/stable/boot-kernel
Sat, 17 Sep. 2022 15:27:40 | HTTP Request - ipxe.cfg-default-amd64
Sat, 17 Sep. 2022 15:27:40 | HTTP Request - /images/windows/amd64/ga-20.04/winserver2016STD5/no-such-image/boot-kernel
Sat, 17 Sep. 2022 15:27:40 | Marking node failed - Missing boot image windows/amd64/ga-20.04/winserver2016STD5.
Sat, 17 Sep. 2022 15:27:40 | Performing PXE boot
Sat, 17 Sep. 2022 15:27:40 | PXE Request - power off
Sat, 17 Sep. 2022 15:27:40 | HTTP Request - ipxe.cfg-52:54:00:6c:f0:5a
Sat, 17 Sep. 2022 15:27:40 | HTTP Request - ipxe.cfg
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running config-power-state-change with frequency once-per-instance
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running config-final-message with frequency always
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running config-ssh-authkey-fingerprints with frequency once-per-instance
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running config-phone-home with frequency once-per-instance
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running config-scripts-user with frequency once-per-instance
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running config-install-hotplug with frequency once-per-instance
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running config-keys-to-console with frequency once-per-instance
Sat, 17 Sep. 2022 15:27:18 | Node status event - 'cloudinit' running modules for final
Sat, 17 Sep. 2022 15:27:18 | Node changed status - From 'Deploying' to 'Failed deployment'
Sat, 17 Sep. 2022 15:27:18 | Marking node failed - Installation failed (refer to the installation log for more information).
Sat, 17 Sep. 2022 15:27:18 | Script - /tmp/curtin-logs.tar failed
Sat, 17 Sep. 2022 15:27:18 | Script - /tmp/install.log failed
Sat, 17 Sep. 2022 15:27:18 | Node installation failure - 'curtin' curtin command install
Sat, 17 Sep. 2022 15:27:16 | Node status event - 'curtin' curtin command block-meta
Sat, 17 Sep. 2022 15:27:16 | Node status event - 'curtin' configuring storage
Sat, 17 Sep. 2022 15:27:16 | Node status event - 'curtin' running 'curtin block-meta custom'

Installation output

curtin: Installation started. (21.3-0ubuntu1~20.04.1)
start: cmd-install/stage-partitioning/builtin/cmd-block-meta: curtin command block-meta
get_path_to_storage_volume for volume vda({'grub_device': True, 'id': 'vda', 'name': 'vda', 'path': '/dev/vda', 'ptable': 'gpt', 'type': 'disk', 'wipe': 'superblock'})
Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
/dev/vda is multipath device member? False
Running command ['partprobe', '/dev/vda'] with allowed return codes [0, 1] (capture=False)
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED udevadm_settle(): 0.142
devsync happy - path /dev/vda now exists
return volume path /dev/vda
get_path_to_storage_volume for volume vda-part1({'device': 'vda', 'flag': 'bios_grub', 'id': 'vda-part1', 'number': 1, 'offset': '4194304B', 'size': '1048576B', 'type': 'partition', 'wipe': 'zero'})
get_path_to_storage_volume for volume vda({'grub_device': True, 'id': 'vda', 'name': 'vda', 'path': '/dev/vda', 'ptable': 'gpt', 'type': 'disk', 'wipe': 'superblock'})
Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
/dev/vda is multipath device member? False
Running command ['partprobe', '/dev/vda'] with allowed return codes [0, 1] (capture=False)
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED udevadm_settle(): 0.074
devsync happy - path /dev/vda now exists
return volume path /dev/vda
get_path_to_storage_volume for volume vda-part2({'device': 'vda', 'id': 'vda-part2', 'name': 'vda-part2', 'number': 2, 'size': '199992803328B', 'type': 'partition', 'uuid': '41bae63d-6654-4427-9ed4-a1a28c612c25', 'wipe': 'superblock'})
get_path_to_storage_volume for volume vda({'grub_device': True, 'id': 'vda', 'name': 'vda', 'path': '/dev/vda', 'ptable': 'gpt', 'type': 'disk', 'wipe': 'superblock'})
Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
/dev/vda is multipath device member? False
Running command ['partprobe', '/dev/vda'] with allowed return codes [0, 1] (capture=False)
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED udevadm_settle(): 0.070
devsync happy - path /dev/vda now exists
return volume path /dev/vda
block-meta: extracted devices to clear: ['/dev/vda']
Declared block devices: ['/dev/vda']
clearing devices=['/dev/vda']
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/vda
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.025
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.024
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/vda']
devname '/sys/class/block/vda' had holders: []
/dev/vda is multipath device partition? False
/dev/vda is multipath device partition? False
/dev/vda is multipath device partition? False
Current device storage tree:
vda
Shutdown Plan:
{'level': 0, 'device': '/sys/class/block/vda', 'dev_type': 'disk'}
shutdown running on holder type: 'disk' syspath: '/sys/class/block/vda'
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/vda'] with allowed return codes [0] (capture=True)
get_blockdev_sector_size: info:
{
 "vda": {
  "ALIGNMENT": "0",
  "DISC-ALN": "512",
  "DISC-GRAN": "512",
  "DISC-MAX": "2147483136",
  "DISC-ZERO": "0",
  "FSTYPE": "",
  "GROUP": "disk",
  "KNAME": "vda",
  "LABEL": "",
  "LOG-SEC": "512",
  "MAJ:MIN": "252:0",
  "MIN-IO": "512",
  "MODE": "brw-rw----",
  "MODEL": "",
  "MOUNTPOINT": "",
  "NAME": "vda",
  "OPT-IO": "0",
  "OWNER": "root",
  "PHY-SEC": "512",
  "RM": "0",
  "RO": "0",
  "ROTA": "1",
  "RQ-SIZE": "256",
  "SIZE": "200000000000",
  "STATE": "",
  "TYPE": "disk",
  "UUID": "",
  "device_path": "/dev/vda"
 }
}
get_blockdev_sector_size: (log=512, phys=512)
Running command ['fdasd', '--table', '/dev/vda'] with allowed return codes [0] (capture=False)
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/vda 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/vda'] with allowed return codes [0] (capture=True)
/dev/vda is multipath device? False
Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
/dev/vda is multipath device member? False
wiping superblock on /dev/vda
wiping /dev/vda attempt 1/4
wiping 1M on /dev/vda at offsets [0, -1048576]
successfully wiped device /dev/vda on attempt 1/4
devname '/sys/class/block/vda' had holders: []
/dev/vda is multipath device partition? False
/dev/vda is multipath device partition? False
/dev/vda 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
Running command ['/usr/sbin/multipath', '-F'] with allowed return codes [0, 1] (capture=False)
installing in 'custom' mode to 'vda'
writing image to disk {'type': 'dd-tgz', 'uri': 'http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd'}, vda
Running command ['sh', '-c', 'wget "$1" --progress=dot:mega -O - |tar -xOzf -| dd bs=4M of="$2"', '--', 'http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd', '/dev/vda'] with allowed return codes [0] (capture=False)
--2022-09-17 15:27:16--  http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd
Connecting to 10.0.0.2:5248... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-09-17 15:27:16 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, 0.0515566 s, 0.0 kB/s
Running command ['partprobe', '/dev/vda'] with allowed return codes [0] (capture=False)
Running command ['udevadm', 'trigger', '/dev/vda'] with allowed return codes [0] (capture=False)
Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
TIMED udevadm_settle(): 0.102
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.027
Searching for filesystem on ['vda'] 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/vda'] with allowed return codes [0] (capture=True)
TIMED BLOCK_META: 1.566
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 2128, 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 ['vda'] that contained one of ['curtin', 'system-data/var/lib/snapd', 'snaps']
Did not find any filesystem on ['vda'] 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 vda({'grub_device': True, 'id': 'vda', 'name': 'vda', 'path': '/dev/vda', 'ptable': 'gpt', 'type': 'disk', 'wipe': 'superblock'})
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
        /dev/vda is multipath device member? False
        Running command ['partprobe', '/dev/vda'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.142
        devsync happy - path /dev/vda now exists
        return volume path /dev/vda
        get_path_to_storage_volume for volume vda-part1({'device': 'vda', 'flag': 'bios_grub', 'id': 'vda-part1', 'number': 1, 'offset': '4194304B', 'size': '1048576B', 'type': 'partition', 'wipe': 'zero'})
        get_path_to_storage_volume for volume vda({'grub_device': True, 'id': 'vda', 'name': 'vda', 'path': '/dev/vda', 'ptable': 'gpt', 'type': 'disk', 'wipe': 'superblock'})
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
        /dev/vda is multipath device member? False
        Running command ['partprobe', '/dev/vda'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.074
        devsync happy - path /dev/vda now exists
        return volume path /dev/vda
        get_path_to_storage_volume for volume vda-part2({'device': 'vda', 'id': 'vda-part2', 'name': 'vda-part2', 'number': 2, 'size': '199992803328B', 'type': 'partition', 'uuid': '41bae63d-6654-4427-9ed4-a1a28c612c25', 'wipe': 'superblock'})
        get_path_to_storage_volume for volume vda({'grub_device': True, 'id': 'vda', 'name': 'vda', 'path': '/dev/vda', 'ptable': 'gpt', 'type': 'disk', 'wipe': 'superblock'})
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
        /dev/vda is multipath device member? False
        Running command ['partprobe', '/dev/vda'] with allowed return codes [0, 1] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.070
        devsync happy - path /dev/vda now exists
        return volume path /dev/vda
        block-meta: extracted devices to clear: ['/dev/vda']
        Declared block devices: ['/dev/vda']
        clearing devices=['/dev/vda']
        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/vda
        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.025
        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.024
        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/vda']
        devname '/sys/class/block/vda' had holders: []
        /dev/vda is multipath device partition? False
        /dev/vda is multipath device partition? False
        /dev/vda is multipath device partition? False
        Current device storage tree:
        vda
        Shutdown Plan:
        {'level': 0, 'device': '/sys/class/block/vda', 'dev_type': 'disk'}
        shutdown running on holder type: 'disk' syspath: '/sys/class/block/vda'
        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/vda'] with allowed return codes [0] (capture=True)
        get_blockdev_sector_size: info:
        {
         "vda": {
          "ALIGNMENT": "0",
          "DISC-ALN": "512",
          "DISC-GRAN": "512",
          "DISC-MAX": "2147483136",
          "DISC-ZERO": "0",
          "FSTYPE": "",
          "GROUP": "disk",
          "KNAME": "vda",
          "LABEL": "",
          "LOG-SEC": "512",
          "MAJ:MIN": "252:0",
          "MIN-IO": "512",
          "MODE": "brw-rw----",
          "MODEL": "",
          "MOUNTPOINT": "",
          "NAME": "vda",
          "OPT-IO": "0",
          "OWNER": "root",
          "PHY-SEC": "512",
          "RM": "0",
          "RO": "0",
          "ROTA": "1",
          "RQ-SIZE": "256",
          "SIZE": "200000000000",
          "STATE": "",
          "TYPE": "disk",
          "UUID": "",
          "device_path": "/dev/vda"
         }
        }
        get_blockdev_sector_size: (log=512, phys=512)
        Running command ['fdasd', '--table', '/dev/vda'] with allowed return codes [0] (capture=False)
        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/vda 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/vda'] with allowed return codes [0] (capture=True)
        /dev/vda is multipath device? False
        Running command ['udevadm', 'info', '--query=property', '--export', '/dev/vda'] with allowed return codes [0] (capture=True)
        /dev/vda is multipath device member? False
        wiping superblock on /dev/vda
        wiping /dev/vda attempt 1/4
        wiping 1M on /dev/vda at offsets [0, -1048576]
        successfully wiped device /dev/vda on attempt 1/4
        devname '/sys/class/block/vda' had holders: []
        /dev/vda is multipath device partition? False
        /dev/vda is multipath device partition? False
        /dev/vda 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
        Running command ['/usr/sbin/multipath', '-F'] with allowed return codes [0, 1] (capture=False)
        installing in 'custom' mode to 'vda'
        writing image to disk {'type': 'dd-tgz', 'uri': 'http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd'}, vda
        Running command ['sh', '-c', 'wget "$1" --progress=dot:mega -O - |tar -xOzf -| dd bs=4M of="$2"', '--', 'http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd', '/dev/vda'] with allowed return codes [0] (capture=False)
        --2022-09-17 15:27:16--  http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd
        Connecting to 10.0.0.2:5248... connected.
        HTTP request sent, awaiting response... 404 Not Found
        2022-09-17 15:27:16 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, 0.0515566 s, 0.0 kB/s
        Running command ['partprobe', '/dev/vda'] with allowed return codes [0] (capture=False)
        Running command ['udevadm', 'trigger', '/dev/vda'] with allowed return codes [0] (capture=False)
        Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED udevadm_settle(): 0.102
        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.027
        Searching for filesystem on ['vda'] 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/vda'] with allowed return codes [0] (capture=True)
        TIMED BLOCK_META: 1.566
        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 2128, 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 ['vda'] that contained one of ['curtin', 'system-data/var/lib/snapd', 'snaps']
        Did not find any filesystem on ['vda'] that contained one of ['curtin', 'system-data/var/lib/snapd', 'snaps']

Stderr: ''
gabriel-samfira commented 1 year ago

Hi @NgatiaFrankline !

My apologies for the late reply.

A bit of context first.

MAAS has 2 methods it uses to install an OS:

Ubuntu and some other Linux OSs are typically installed using the first method. MAAS partitions the disk, formats it according to the partition layout for that nodes, unarchives the OS on the root file system, installs GRUB and reboots.

Windows and other foreign OSs are installed using full disk images. This is similar to how Openstack Ironic installs a new node or how a VM is deployed in a cloud.

Judging by the output from MAAS, it seems that the image was not uploaded as a full disk image and MAAS is attempting to install it using the first method.

If I may ask, how did you upload the image? If you have not already done so, please make sure you've uploaded the image using the following command:

maas admin boot-resources create \
    title="Windows Server 2016 Standard" \
    name=windows/win2016 \
    architecture=amd64/generic \
    filetype=ddtgz \
    content@=$HOME/windows-win2016-amd64-root-dd

In the above command, the important bits are:

For a full list of options and possible values, please see:

maas admin boot-resources create --help

Let me know if this helps, and again, my apologies for the late reply.

mykolq commented 1 year ago

the same error with maas 3.4 (and 3.3, and 3.2). I have tried win 2k19

ader1990 commented 1 year ago

Hello @NgatiaFrankline @mykolq,

From the error logs you sent:

http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd
        Connecting to 10.0.0.2:5248... connected.
        HTTP request sent, awaiting response... 404 Not Found
        gzip: stdin: unexpected end of file

There is an issue on your setup with the URL of the image --> http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd, it seems it is not a valid URL.

@mykolq do you have the same issue with the URL not being valid?

This is usually a problem with how MAAS was installed or the access to its http storage or with how the Windows image has been created.

Thank you.

mykolq commented 12 months ago

sorry for late answer. i' ve used this script https://github.com/cloudbase/windows-imaging-tools/blob/master/Examples/create-windows-cloud-image.ps1, than archived raw to .gz and import it to maas by command like that maas maas_api_admin boot-resources create name=windows/windowsServer2019dc title="windowsServer2019dc" architecture=amd64/generic content@=/src/maas_files/packer_output/windows-2019/standard.tar.gz

ader1990 commented 12 months ago

Hello @mykolq,

You need to use the https://github.com/cloudbase/windows-imaging-tools#new-windowsonlineimage New-WindowsOnlineImage command to create a working image.

New-WindowsCloudImage
This command does not require Hyper-V to be enabled, but the generated image
is not ready to be deployed, as it needs to be started manually on another hypervisor.
The image is ready to be used when it shuts down.

You can find a PowerShell example to generate a raw OpenStack Ironic image that also works on KVM
in Examples/create-windows-cloud-image.ps1

Thank you.

mykolq commented 12 months ago

Thank you, I am trying this now

mykolq commented 11 months ago

Hello @NgatiaFrankline @mykolq,

From the error logs you sent:

http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd
        Connecting to 10.0.0.2:5248... connected.
        HTTP request sent, awaiting response... 404 Not Found
        gzip: stdin: unexpected end of file

There is an issue on your setup with the URL of the image --> http://10.0.0.2:5248/images/windows/amd64/generic/winserver2016STD5/uploaded/root-dd, it seems it is not a valid URL.

@mykolq do you have the same issue with the URL not being valid?

This is usually a problem with how MAAS was installed or the access to its http storage or with how the Windows image has been created.

Thank you.

sorry for a stupid question. what is the correct way of importing file, created by this script? it seems. i have tried filetype=ddraw, filetype=tgz, filetype=ddtgz and had error in install log like that --2023-11-24 13:57:24-- http://192.168.164.1:5248/images/custom/amd64/generic/win2019dc/uploaded/root-dd Connecting to 192.168.164.1:5248... connected. HTTP request sent, awaiting response... 200 OK Length: 12886999040 (12G) [application/octet-stream] Saving to: ‘STDOUT’ 0K gzip: stdin: not in gzip format .tar: Child died with signal 13

ader1990 commented 11 months ago

@mykolq

It is best to check the file before hand using the command file or qemu-img info to make sure that the image file respects the filetype=ddtgz content@=$HOME/windows-win2016-amd64-root-dd -- > in this case the image is a .raw.tar.gz file

mykolq commented 11 months ago

@mykolq

It is best to check the file before hand using the command file or qemu-img info to make sure that the image file respects the filetype=ddtgz content@=$HOME/windows-win2016-amd64-root-dd -- > in this case the image is a .raw.tar.gz file

thanks. it is raw file on script exit. Now there is another error with image Command: ['curtin', 'in-target', '--', 'bash', '-c', 'cloud-init --version || (echo "cloud-init not detected, MAAS will not be able to configure this machine properly" && exit 1)'] Exit code: 127 But i can see Cloudbase-Init folder with files in image (c:\Program Files\Cloudbase Solutions\Cloudbase-Init)