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

Unhandled error on VM creation #7

Open
eliasp opened this issue Mar 5, 2021 · 0 comments
Open

Unhandled error on VM creation #7

eliasp opened this issue Mar 5, 2021 · 0 comments

Comments

@eliasp
Copy link
Contributor

eliasp commented Mar 5, 2021

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 &&.

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

1 participant