Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom blueprints doesn't work #66

Open
vilm725 opened this issue Nov 19, 2024 · 6 comments
Open

Custom blueprints doesn't work #66

vilm725 opened this issue Nov 19, 2024 · 6 comments

Comments

@vilm725
Copy link

vilm725 commented Nov 19, 2024

Hi everyone 👋🏻

I can't get the personal blueprints to work locally, even when put in my github repo (kde neon, ubuntu distrib 24.04 lts), despite forced update with multipass find --force-update and multipass find --only-blueprints. The multipass launch file://myblueprint command doesn't work with local blueprints either (see this article: https://discourse.ubuntu.com/t/doc-suggestion-how-to-use-custom-blueprints/42847).

However, my cloud-init files work fine, for example: multipass launch -n mydocker --cloud-init https://raw.githubusercontent.com/vilm725/multipass-blueprints/refs/heads/main/docker-custom.yml

I read the very short doc on the subject (https://github.com/canonical/multipass-blueprints?tab=readme-ov-file#testing) and saw that you have to modify the file /etc/systemd/system/snap.multipass.multipassd.service.d/override.conf in order to make blueprints work. So I put a blueprint in my repo and another cloud init file to test them: https://github.com/vilm725/multipass-blueprints/

Here's what I've put in this file:

[Service]
Environment=MULTIPASS_STORAGE=/path/to/my/external/ssd/multipass/
Environment="MULTIPASS_BLUEPRINTS_URL=https://github.com/vilm725/multipass-blueprints/archive/refs/heads/main.zip"

Finally, I restarted multipass:

sudo snap restart multipass

When I search for my blueprints, I can't find anything:

$ multipass find --force-update
$ multipass find --only-blueprints
No blueprints found.
$ multipass launch customdocker
launch failed: Unable to find an image matching “customdocker” in remote “”.

So, please, how do you get blueprints to work? I confess I don't understand, the documentation is really minimal on this subject.

@Sploder12
Copy link

Hi @vilm725,

Sorry to hear things aren't working, I agree the documentation is minimal on this. For multipass launch file://<path>, double check you entered the path correctly. Otherwise, it could be an issue with the blueprint files or file permissions. An issue with the blueprints could also explain why find isn't finding the blueprints.

Looking at your blueprint files, I noticed a few issues that could be preventing it from working. One is the instance/blueprint name, you're using customdocker but the blueprint and instance name will be the filename without .yml. For example, for v1/docker-blueprint.yml it should be docker-blueprint. Also for your runs-on section, uncommenting x86_64 worked for me. The vendor-data section might give you issues, if it does, try removing it. This is because Multipass injects its own vendor-data section which might conflict with yours. Finally, your limits for memory and disk should probably have the G suffixes since they default to bytes without the suffix.

Looking at the layout of the zip, make sure all your blueprints are in the v1 folder, since Multipass will ignore them otherwise.

Let me know if trying this works! If it doesn't, would you be able to send your Multipass logs and the output of multipass launch file://<path>?

@vilm725
Copy link
Author

vilm725 commented Nov 19, 2024

Hi @Sploder12 👋🏻

First of all, THANK YOU SO MUCH for all your advice. I don't understand why your information isn't in the doc ...

I apologize if I got the names wrong. I had one version of the files on github and another locally in order to perform several tests. For this test, I decided to make a git clone to avoid filename errors and the like.

I've modify docker-blueprint.yml like this, the most minimal :

description: Custom docker # * a short description of the blueprint ("tagline")
version: latest          # * a version string

# multipass launch customdocker
# OU
# multipass launch customdocker --name docker-dev --cpus 4 --memory 8G --disk 50G

runs-on:                   # a list of architectures this blueprint can run on
# - arm64                    #   see https://doc.qt.io/qt-5/qsysinfo.html#currentCpuArchitecture
- x86_64                   #   for a list of valid values
- amd64

instances:
  customdocker:                  # * equal to the blueprint name
    image: 24.04    # a valid image alias, see `multipass find` for available values
    limits:
      min-cpu: 2       # the minimum number of CPUs this blueprint can work with
      min-mem: 4G    # the minimum amount of memory (can use G/K/M/B suffixes)
      min-disk: 20G   # and the minimum disk size (as above)
    #timeout: 1800         # maximum time for the instance to launch, and separately for cloud-init to complete
    cloud-init:
      vendor-data: |       # cloud-init vendor data

I've entered this command and, unlike usual, I don't get an immediate error, but rather 5 long minutes, only to get an time out error :

:~/Desktop/blueprints$ multipass launch https://raw.githubusercontent.com/vilm725/multipass-blueprints/refs/heads/main/v1/docker-blueprint.yml

launch failed: The following errors occurred:
devout-satyr: timed out waiting for response

:~$ multipass list 
Name                    State             IPv4             Image
dexterous-turnstone     Unknown           --               Not Available

After that command, multipass crash everytime :

# I restart mutlipass, 5 minutes ...
sudo snap restart multipass
[sudo] password for : 
2024-11-19T20:17:06+01:00 INFO Waiting for "snap.multipass.multipassd.service" to stop.
Run service command "restart" for running services of snap "multipass"

I've test file:// and I've test multipass launch with the name of the file without the yaml file extension but ... It doesn't work :

soso@soso:~/Desktop/multipass-blueprints/v1$ ls -la
total 12
drwxrwxr-x 2 soso soso 4096 nov.  19 20:39 .
drwxrwxr-x 4 soso soso 4096 nov.  19 20:39 ..
-rw-rw-r-- 1 soso soso 2147 nov.  19 20:39 docker-blueprint.yml

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass launch docker-blueprint
launch failed: Unable to find an image matching "docker-blueprint" in remote "".

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass launch docker-blueprint.yml
launch failed: Unable to find an image matching "docker-blueprint.yml" in remote "".

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass launch file://docker-blueprint.yml
launch failed: There are no instance definitions matching Blueprint name "docker-blueprint"

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass launch file://home/soso/Desktop/multipass-blueprints/v1/docker-blueprint.yml
launch failed: Wrong file '/home/soso/Desktop/multipass-blueprints/v1/home/soso/Desktop/multipass-blueprints/v1/docker-blueprint.yml'

This is the log file :

nov. 19 20:28:46 soso multipassd[157845]: Reading Blueprint 'blueprint-custom-docker' from file /home/soso/Desktop/blueprints/home/soso/Desktop/blueprints/blueprint-custom-docker.yml
nov. 19 20:28:53 soso multipassd[157845]: [159030] started: qemu-system-x86_64 --version
nov. 19 20:29:06 soso multipassd[157845]: [159118] started: qemu-system-x86_64 --version
nov. 19 20:29:06 soso multipassd[157845]: Reading Blueprint 'blueprint-custom-docker' from file /home/soso/Desktop/blueprints/blueprint-custom-docker.yml
nov. 19 20:29:13 soso multipassd[157845]: [159196] started: qemu-system-x86_64 --version
nov. 19 20:29:13 soso multipassd[157845]: Reading Blueprint 'blueprint-custom-docker' from file /home/soso/Desktop/blueprints/home/soso/Desktop/blueprints/blueprint-custom-docker.yml
nov. 19 20:31:23 soso multipassd[157845]: [159564] started: qemu-system-x86_64 --version
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:31:24 soso multipassd[157845]: [159574] started: qemu-img info --output=json /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/cache/vault/images/docker-blueprint-/docker-blueprint.yml
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:31:24 soso multipassd[157845]: [159579] started: qemu-img convert -p -O qcow2 /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/cache/vault/images/docker-blueprint-/docker-blueprint.yml /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/cache/vault/images/docker-blueprint-/docker-blueprint.yml.qcow2
nov. 19 20:31:24 soso multipassd[157845]: Failed to remove AppArmor policy 
                                          #include <tunables/global>
                                          profile multipass.qemu-img flags=(attach_disconnected) {
                                            #include <abstractions/base>
                                          
                                            capability ipc_lock,
                                            capability dac_read_search,
                                            
                                          
                                            # binary and its libs
                                            /snap/multipass/13373/usr/bin/qemu-img ixr,
                                            /snap/multipass/13373/{usr/,}lib/@{multiarch}/{,**/}*.so* rm,
                                          
                                            # CLASSIC ONLY: need to specify required libs from core snap
                                            /{,var/lib/snapd/}snap/core18/*/{,usr/}lib/@{multiarch}/{,**/}*.so* rm,
                                          
                                            # Images
                                            /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/cache/vault/images/docker-blueprint-/docker-blueprint.yml rwk,
                                          
                                          
                                            # Allow multipassd send qemu-img signals
                                            signal (receive) peer=snap.multipass.multipassd,
                                          }
                                              : errno=254 ()
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:31:24 soso multipassd[157845]: [159588] started: qemu-img amend -o compat=1.1 /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/cache/vault/images/docker-blueprint-/docker-blueprint.yml.qcow2
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:31:24 soso multipassd[157845]: [159595] started: qemu-img info /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/cache/vault/images/docker-blueprint-/docker-blueprint.yml.qcow2
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:31:24 soso multipassd[157845]: [159603] started: qemu-img resize /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/docker-blueprint.yml.qcow2 5368709120
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:31:24 soso multipassd[157845]: [159610] started: qemu-img snapshot -l /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/docker-blueprint.yml.qcow2
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:31:24 soso multipassd[157845]: [159617] started: qemu-img amend -o compat=1.1 /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/docker-blueprint.yml.qcow2
nov. 19 20:31:24 soso multipassd[157845]: process working dir '/snap/multipass/13373/qemu'
nov. 19 20:31:24 soso multipassd[157845]: process program 'qemu-system-x86_64'
nov. 19 20:31:24 soso multipassd[157845]: process arguments '-bios, OVMF.fd, --enable-kvm, -cpu, host, -nic, tap,ifname=tap-5a93cb7547c,script=no,downscript=no,model=virtio-net-pci,mac=52:54:00:b1:db:82, -device, virtio-scsi-pci,id=scsi0, -drive, file=/media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/docker-blueprint.yml.qcow2,if=none,format=qcow2,discard=unmap,id=hda, -device, scsi-hd,drive=hda,bus=scsi0.0, -smp, 1, -m, 1024M, -qmp, stdio, -chardev, null,id=char0, -serial, chardev:char0, -nographic, -cdrom, /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/cloud-init-config.iso'
nov. 19 20:31:24 soso multipassd[157845]: [159648] started: qemu-system-x86_64 -nographic -dump-vmstate /tmp/multipassd.sTnnoF
nov. 19 20:31:24 soso multipassd[157845]: Applied AppArmor policy: multipass.dexterous-turnstone.qemu-system-x86_64
nov. 19 20:31:24 soso multipassd[157845]: process state changed to Starting
nov. 19 20:31:24 soso multipassd[157845]: process state changed to Running
nov. 19 20:31:24 soso multipassd[157845]: [159650] started: qemu-system-x86_64 -bios OVMF.fd --enable-kvm -cpu host -nic tap,ifname=tap-5a93cb7547c,script=no,downscript=no,model=virtio-net-pci,mac=52:54:00:b1:db:82 -device virtio-scsi-pci,id=scsi0 -drive file=/media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/docker-blueprint.yml.qcow2,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 1 -m 1024M -qmp stdio -chardev null,id=char0 -serial chardev:char0 -nographic -cdrom /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/cloud-init-config.iso
nov. 19 20:31:24 soso multipassd[157845]: process started
nov. 19 20:31:24 soso multipassd[157845]: Waiting for SSH to be up
nov. 19 20:41:54 soso multipassd[163027]: Loading "anbox-cloud-appliance" v1
nov. 19 20:41:54 soso multipassd[163027]: Loading "charm-dev" v1
nov. 19 20:41:54 soso multipassd[163027]: Loading "docker" v1
nov. 19 20:41:54 soso multipassd[163027]: Loading "jellyfin" v1
nov. 19 20:41:54 soso multipassd[163027]: Loading "minikube" v1
nov. 19 20:41:54 soso multipassd[163027]: Loading "ros2-humble" v1
nov. 19 20:41:54 soso multipassd[163027]: Loading "ros2-jazzy" v1
nov. 19 20:41:54 soso multipassd[163027]: gRPC listening on unix:/var/snap/multipass/common/multipass_socket
nov. 19 20:41:54 soso multipassd[163027]: fetch manifest periodically
nov. 19 20:41:54 soso multipassd[163027]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:41:54 soso multipassd[163027]: [163168] started: qemu-img snapshot -l /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/docker-blueprint.yml.qcow2
nov. 19 20:41:54 soso multipassd[163027]: Applied AppArmor policy: multipass.qemu-img
nov. 19 20:41:54 soso multipassd[163027]: [163181] started: qemu-img amend -o compat=1.1 /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/vault/instances/dexterous-turnstone/docker-blueprint.yml.qcow2
nov. 19 20:41:54 soso multipassd[163027]: Starting Multipass 1.14.1
nov. 19 20:41:54 soso multipassd[163027]: Daemon arguments: /snap/multipass/13373/bin/multipassd --verbosity debug --logger platform
nov. 19 20:51:03 soso multipassd[163027]: Loading "anbox-cloud-appliance" v1
nov. 19 20:51:03 soso multipassd[163027]: Loading "charm-dev" v1
nov. 19 20:51:03 soso multipassd[163027]: Loading "docker" v1
nov. 19 20:51:03 soso multipassd[163027]: Loading "jellyfin" v1
nov. 19 20:51:03 soso multipassd[163027]: Loading "minikube" v1
nov. 19 20:51:03 soso multipassd[163027]: Loading "ros2-humble" v1
nov. 19 20:51:03 soso multipassd[163027]: Loading "ros2-jazzy" v1
nov. 19 20:51:03 soso multipassd[163027]: [164592] started: qemu-system-x86_64 --version
nov. 19 20:51:03 soso multipassd[163027]: Reading Blueprint 'docker-blueprint' from file /home/soso/Desktop/multipass-blueprints/v1/docker-blueprint.yml
nov. 19 20:51:50 soso multipassd[163027]: [164752] started: qemu-system-x86_64 --version
nov. 19 20:51:50 soso multipassd[163027]: Reading Blueprint 'docker-blueprint' from file /home/soso/Desktop/multipass-blueprints/v1/home/soso/Desktop/multipass-blueprints/v1/docker-blueprint.yml
nov. 19 20:56:54 soso multipassd[163027]: fetch manifest periodically
nov. 19 21:00:50 soso multipassd[163027]: Loading "anbox-cloud-appliance" v1
nov. 19 21:00:50 soso multipassd[163027]: Loading "charm-dev" v1
nov. 19 21:00:50 soso multipassd[163027]: Loading "docker" v1
nov. 19 21:00:50 soso multipassd[163027]: Loading "jellyfin" v1
nov. 19 21:00:50 soso multipassd[163027]: Loading "minikube" v1
nov. 19 21:00:50 soso multipassd[163027]: Loading "ros2-humble" v1
nov. 19 21:00:50 soso multipassd[163027]: Loading "ros2-jazzy" v1
nov. 19 21:00:50 soso multipassd[163027]: [165719] started: qemu-system-x86_64 --version
nov. 19 21:00:50 soso multipassd[163027]: Reading Blueprint 'docker-blueprint' from file /home/soso/Desktop/multipass-blueprints/v1/home/soso/Desktop/multipass-blueprints/v1/docker-blueprint.yml
nov. 19 21:00:55 soso multipassd[163027]: [165792] started: qemu-system-x86_64 --version
nov. 19 21:00:55 soso multipassd[163027]: Reading Blueprint 'docker-blueprint' from file /home/soso/Desktop/multipass-blueprints/v1/docker-blueprint.yml

To sum up, there's only this command multipass launch https://raw.githubusercontent.com/vilm725/multipass-blueprints/refs/heads/main/v1/docker-blueprint.yml that “loads” for 5 minutes but ends with an timeout error, whereas before it stopped immediately.

Honestly, I don't understand why it doesn't work. The log file above doesn't describe any glaring errors ... Do you have any idea?

Full log file :
multipass-log.txt

@Sploder12
Copy link

Thank you for providing so much detail @vilm725!

Blueprints can take a long time to load so I recommend setting a long timeout, but this appears to be a more interesting issue. Could you try modifying line 14 of docker-blueprint.yml like so? If that doesn't work, try also removing vendor-data and cloud-init entirely. This could be a bug in how we handle instance names.

- customdocker:                  # * equal to the blueprint name
+ docker-blueprint:              # * equal to the blueprint name

If Multipass crashes badly, restarting your machine will get it back to normal. You can also try sending SIGKILL to any hanging Multipass processes, but beware of potential data loss.

@vilm725
Copy link
Author

vilm725 commented Nov 20, 2024

Hi @Sploder12 👋🏻

I would like to thank you again for your answers. I apologize for the late reply. There's a 6-hour time difference between your city and mine.

I've rename customerdocker to docker-blueprint, you asked me to do this earlier, but I think the fatigue and frustration of yesterday has made me lose my nerve 😄 Unfortunately, it doesn't work either when I rename it this way

Concerning the timeout function. If I remove (or comment on) the timeout line, is that enough, or do I have to set a very high value? The script in the vendor data function configures a vm with a docker installation in script mode (fast enough for a test environment) in just 1min and 9seconds. Do you really think that the fact that it's a blueprint will make the process much slower?


Tests

Note

I would like to clarify that I will be using a minimal blueprint for the test below, a blueprint that looks like this:

description: Custom docker
version: latest        
runs-on:                 
- x86_64                 
- amd64
instances:
  docker-blueprint:      
    image: 24.04    
    limits:
      min-cpu: 2    
      min-mem: 4G   
      min-disk: 20G

Concerning the vendor-data and cloud-init. I've just tried removing the cloud-init and vendor-data sections completely. I thought it would be enough if I only removed the command lines.
When I use multipass launch file://, it's work ✅:

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass launch file://docker-blueprint.yml
Launched: docker-blueprint

The vm has the same properties as the blueprint file :

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass info docker-blueprint 
Name:           docker-blueprint
State:          Running
Snapshots:      0
IPv4:           10.212.216.24
Release:        Ubuntu 24.04.1 LTS
Image hash:     5dc7f9c79644 (Ubuntu 24.04 LTS)
CPU(s):         2
Load:           0.00 0.03 0.01
Disk usage:     1.8GiB out of 19.3GiB
Memory usage:   408.2MiB out of 3.8GiB
Mounts:         --

Note

In this second test, I add the cloud-init and vendor-data functions to my blueprint, blueprint that looks like this:

description: Custom docker
version: latest        
runs-on:                 
- x86_64                 
- amd64
instances:
  docker-blueprint:      
    image: 24.04    
    limits:
      min-cpu: 2    
      min-mem: 4G   
      min-disk: 20G 
    #timeout: 1800  
    cloud-init:
      vendor-data: |

        timezone: Europe/Paris
       
        users:
        - name: soso
          gecos: soso User
          shell: /bin/bash
          home: /home/soso
          groups: users,admin,wheel,lxd,docker
          sudo: ALL=(ALL) NOPASSWD:ALL

Very strange result 🤔:

soso@soso:~$ multipass launch file://Desktop/multipass-blueprints/v1/docker-blueprint.yml
launch failed: Cannot merge values of timezone:
Europe/Paris


Europe/Paris

Anyway, I'm leaving the timezone aside and testing the basic docker installation and ... It's work ✅ :

description: Custom docker
[...]
      vendor-data: |
        users:
        - name: ubuntu
          gecos: Ubuntu User
          shell: /bin/bash
          home: /home/ubuntu
          groups: users,admin,wheel,lxd,docker
          sudo: ALL=(ALL) NOPASSWD:ALL

        packages:
          - apt-transport-https
          - bash-completion
          - ca-certificates
          - curl
          - git
          - uidmap
         
        runcmd:
          - curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh
          - curl -fsSL https://get.docker.com/rootless --force | sh
          - systemctl start docker
          - systemctl enable docker
        final_message: "The system is finally up, after $UPTIME seconds"

health-chelmck: |            # a health-check shell script ran by integration tests
  docker version
  docker run hello-world

Do you know how to check that the tests have been carried out? A log file for this test ?


Note

Last test, using multipass launch . The blueprint is the same as above, but without the timezone, as this is a problem.

I've test with this command, doesn't work ❌ :

soso@soso:~$ multipass launch https://raw.githubusercontent.com/vilm725/multipass-blueprints/refs/heads/main/v1/docker-blueprint.yml
launch failed: The following errors occurred:
healthful-muskox: timed out waiting for response

I'd like to add that every time I run the multipass launch command with a git link, multipass crashes, and I'm forced to restart multipass by waiting at least 5/10min using this command sudo snap restart multipass.

Note

In this third test, I using multipass launch <blueprint name>. The blueprint is the same as above, but without the timezone, as this is a problem.

My blueprint is displayed ✅ :

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass find
Image                       Aliases           Version          Description

[...]

Blueprint                   Aliases           Version          Description
docker-blueprint                              latest           Custom docker

I launch my blueprint using its name, it work ✅:

soso@soso:~/Desktop/multipass-blueprints/v1$ multipass launch docker-blueprint
launch failed: Unable to find an image matching "docker-blueprint" in remote "".

how can I display canonical's old blueprints, which are just as interesting, but at the same time display my own? A more concise question: can I display several different blueprint sources?


I've uploaded the log file of this (already very frustrating 😄) morning. It's much shorter than yesterday, maybe you'll find a mistake I didn't see?

log.txt

The rare errors I find are:

  • “Failed to remove AppArmor policy” (line741 to 839)
  • Cannot fetch image information: Unable to find an image matching hash” (line 805) and from the, multipass crash to the line
  • an error on line 839 concerning (cannot read /media/soso/b24d9c94-c66c-4dec-9635-1bf2bd8bdeea/multipass/data/network/dnsmasq.hosts: Permission denied)

Conclusion:

  • multipass launch file:// with the same file name as the blueprint name
  • multipass launch docker-blueprint it work (respecting the name of the v1 folder at the remote git root)
  • timezone: "Europe/Paris" launch failed: Cannot merge values of timezone:
  • ❌ ``multipass launch https://raw.githubusercontent.com/[...] ````blocks multipass completely for several minutes, even with a sudo snap restart multipass
  • multipass start after building the blueprint via a remote git, multipass crashes again

Suggestion

I think it's urgent to add to blueprint documentation (https://multipass.run/docs/blueprint + https://multipass.run/docs/use-a-blueprint), even if it's not perfect :

  • to have the same file name as the blueprint name (without the extension)
  • show an example of how to run a blueprint locally, using the multipass launch command [...] file://myblueprint.yml
  • show an example of blueprint execution via a remote git repo, ``multipass launch https://raw.githubusercontent.com/[...] `````
  • show an example of the folder hierarchy in the remote git, with all the importance of the v1 folder which is not mentioned anywhere

Even if it's not perfect, it will allow many people to forget about cloud init and multipass. It will save other people precious hours of time.

I'd like to contribute to the documentation of these two pages by showing short, clear and concise examples of the use of blueprints. How can I do this?

Irrelevant question

I couldn't find it in the documentation either: how can I launch several vm via a cloud init or a blueprint? It's a silly question, but so essential.

@Sploder12
Copy link

Sploder12 commented Nov 20, 2024

Hello @vilm725 👋

Thank you again for providing so much detail! I took a look into using launch https://<url> with the blueprints from this repo and I'm experiencing the same hanging issue. So it's definitely a bug with Multipass, I created an issue here to track it.

As for the timeout, your blueprint is relatively light so using the default timeout is reasonable. But it is a common problem with heavy blueprints.

The integration tests mentioned by health-chelmck are related to the GitHub Actions of this repo, so they won't run for you. The action evaluates the value of health-check and checks that the output is success.

The timezone: "Europe/Paris" issue comes from how we augment the cloud-init vendor-data. Multipass detects the timezone of the host and injects that as a parameter. But since you have it defined, Multipass gets confused when it tries to inject it. The code that does this will error out in the case of it already being defined.

Unfortunately, there is no reasonable way to display multiple blueprint sources at once. A potential workaround would be having single source that aggregates all the sources you want, but that's cumbersome.

Looking at the logs, the Cannot fetch image information appears to be related to the launch https://<url> bug. AppArmor does that normally. The dnsmasq.hosts: Permission denied is interesting, are you having an issues accessing VMs you create? Also towards the top of your logs there are several failed web requests "Cannot retrieve headers for <url>", I wonder why that is.

Your question about launching several vms is not silly! But the answer is that unfortunately that functionality is not present. Although the blueprint schema supports it, it is not implemented.

We will follow up on documentation in the near future, thank you for your interest! 😄

@vilm725
Copy link
Author

vilm725 commented Nov 20, 2024

Hello @Sploder12 👋🏻

Looking at the logs, the Cannot fetch image information appears to be related to the launch https:// bug. AppArmor does that normally. The dnsmasq.hosts: Permission denied is interesting, are you having an issues accessing VMs you create? Also towards the top of your logs there are several failed web requests "Cannot retrieve headers for ", I wonder why that is.

No problem at all with access to my vms. Whether with a multipass shell or to access them with vscodium (vscode)

Your question about launching several vms is not silly! But the answer is that unfortunately that functionality is not present. Although the blueprint schema supports it, it is not implemented.
Ooo no ... It's a good thing bash exists 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants