Skip to content

Unhandled error on VM creation #7

Description

@eliasp

When creating a new VM fails (in this case due to an invalid memory specification), the error isn't properly handled and samutev attempts to continue:

$ samutev.sh -s 'master:c1:m0.5:d3 minion:c1:m0.5:d3'
launching master (master with cpu=1 mem=0.5G disk=3G and image 'focal')
launch failed: Invalid arguments supplied
Invalid memory size value supplied: 0.5G.
exec failed: instance "master" does not exist
exec failed: instance "master" does not exist
mount failed: The following errors occurred:
instance "master" does not exist
mount failed: The following errors occurred:
instance "master" does not exist
exec failed: instance "master" does not exist
mount failed: The following errors occurred:
instance "master" does not exist
exec failed: instance "master" does not exist
mount failed: The following errors occurred:
instance "master" does not exist
exec failed: instance "master" does not exist

info failed: The following errors occurred:
instance "master" does not exist
launched  master in 0 minutes and 0 seconds.


info failed: The following errors occurred:
instance "master" does not exist
launching minion (minion with cpu=1 mem=0.5G disk=3G and image 'focal')
launch failed: Invalid arguments supplied
Invalid memory size value supplied: 0.5G.
info failed: The following errors occurred:
instance "minion" does not exist
launched  minion in 0 minutes and 0 seconds.


ssh: Could not resolve hostname : Name or service not known

alltogether: 00:00 min.

READY to go:
    ssh root@
    salt '*' test.ping

This is most likely due to multipass being launched unconditionally in line 271:

multipass launch --cpus "${CPU}" --disk "${DISK}"G --mem "${MEM}"G --name "${VM}" --cloud-init tmp_cloudinit.$$ "${IMAGE}";

This could be prevented by chaining the abort handling to it using &&.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions