Custom images which worked ok is not working with 3.2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Adam Collard | ||
3.1 |
Fix Released
|
High
|
Mauricio Faria de Oliveira | ||
3.2 |
Fix Released
|
High
|
Adam Collard | ||
3.3 |
Fix Released
|
High
|
Adam Collard | ||
3.4 |
Fix Released
|
High
|
Adam Collard |
Bug Description
The customer said after upgrading to maas 3.2, they can't use their custom images anymore.
The customer analyzed a bit about this and get_custom_
The error is below [1]
I'm trying to test this as well but takes time. In the mean time, I would appreciate if you can have any kind of advices.
If they bypass the validation function, it works.
I'll reinforce the info after testing.
Thanks.
[1]
finish: cmd-install/
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: 1
Reason: -
Stdout: start: cmd-install/
Running command ['mount', '--bind', '/dev', '/tmp/tmpx2g387
Running command ['mount', '--bind', '/proc', '/tmp/tmpx2g387
Running command ['mount', '--bind', '/run', '/tmp/tmpx2g387
Running command ['mount', '--bind', '/sys', '/tmp/tmpx2g387
Running command ['unshare', '--help'] with allowed return codes [0] (capture=True)
Running command ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpx2g387
bash: dpkg-query: command not found
cloud-init not detected, MAAS will not be able to configure this machine properly
Related branches
- MAAS Lander: Needs Fixing
- Mauricio Faria de Oliveira: Approve
-
Diff: 118 lines (+21/-24)2 files modifiedsrc/maasserver/preseed.py (+13/-16)
src/maasserver/tests/test_preseed.py (+8/-8)
- MAAS Lander: Approve
- MAAS Maintainers: Pending requested
-
Diff: 118 lines (+21/-24)2 files modifiedsrc/maasserver/preseed.py (+13/-16)
src/maasserver/tests/test_preseed.py (+8/-8)
- Adam Collard (community): Approve
-
Diff: 118 lines (+21/-24)2 files modifiedsrc/maasserver/preseed.py (+13/-16)
src/maasserver/tests/test_preseed.py (+8/-8)
- MAAS Lander: Approve
- MAAS Maintainers: Pending requested
-
Diff: 118 lines (+21/-24)2 files modifiedsrc/maasserver/preseed.py (+13/-16)
src/maasserver/tests/test_preseed.py (+8/-8)
- MAAS Lander: Needs Fixing
- Alberto Donato (community): Approve
-
Diff: 118 lines (+21/-24)2 files modifiedsrc/maasserver/preseed.py (+13/-16)
src/maasserver/tests/test_preseed.py (+8/-8)
- MAAS Lander: Approve
- Adam Collard: Pending requested
-
Diff: 15 lines (+4/-1)1 file modifiedsrc/maasserver/preseed.py (+4/-1)
- Jack Lloyd-Walters: Abstain
- MAAS Lander: Approve
-
Diff: 88 lines (+54/-2)2 files modifiedsrc/maasserver/preseed.py (+14/-2)
src/maasserver/tests/test_preseed.py (+40/-0)
tags: | added: sts |
tags: | added: bug-council |
Changed in maas: | |
status: | New → Won't Fix |
status: | Won't Fix → Confirmed |
Changed in maas: | |
milestone: | 3.5.0 → 3.3.x |
no longer affects: | maas/3.4 |
Changed in maas: | |
status: | Incomplete → Triaged |
Changed in maas: | |
status: | Triaged → Fix Committed |
Changed in maas: | |
milestone: | 3.2.x → 3.5.0 |
assignee: | nobody → Adam Collard (adam-collard) |
Changed in maas: | |
importance: | Medium → High |
Changed in maas: | |
milestone: | 3.5.0 → 3.5.0-beta1 |
status: | Fix Committed → Fix Released |
Workaround: (bypass `dpkg-query` for the custom image validation commands)
Edit `curtin_ userdata_ custom` : preseeds/ `. maas/current/ preseeds/ ` copy the file userdata_ custom. sample` as `curtin_ userdata_ custom` .
- On debs, it's in `/etc/maas/
- On snaps, in `/var/snap/
`curtin_
Add the following 2 lines to `late_commands` (indented with 2 spaces):
00-validate- custom- image-aaa- workaround: ['curtin', 'in-target', '--', '/bin/sh', '-c', 'ln -s $(which true) /usr/local/ bin/dpkg- query'] custom- image-zzz- workaround: ['curtin', 'in-target', '--', '/bin/sh', '-c', 'rm -f /usr/local/ bin/dpkg- query']
99-validate-
...
Before:
... cloud-init[1605]: finish: cmd-install/ stage-late/ 98-validate- custom- image-has- cloud-init: FAIL: running 'curtin in-target -- bash -c dpkg-query -s cloud-init || (echo "cloud-init not detected, ..." && exit 1)'
...
... cloud-init[1605]: curtin: Installation failed with exception: Unexpected error while running command.
After:
... cloud-init[1636]: finish: cmd-install/ stage-late/ 00-validate- custom- image-aaa- workaround: SUCCESS: running 'curtin in-target -- /bin/sh -c ln -s $(which true) /usr/local/ bin/dpkg- query' stage-late/ 98-validate- custom- image-has- cloud-init: SUCCESS: running 'curtin in-target -- bash -c dpkg-query -s cloud-init || (echo "cloud-init not detected, ..." && exit 1)' stage-late/ 99-validate- custom- image-has- netplan. io: SUCCESS: running 'curtin in-target -- bash -c dpkg-query -s netplan.io || (echo "netplan.io not detected, ..." && exit 1)' stage-late/ 99-validate- custom- image-zzz- workaround: SUCCESS: running 'curtin in-target -- /bin/sh -c rm -f /usr/local/ bin/dpkg- query'
...
... cloud-init[1636]: finish: cmd-install/
...
... cloud-init[1636]: finish: cmd-install/
...
... cloud-init[1636]: finish: cmd-install/
...
... cloud-init[1636]: curtin: Installation finished.