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

virt - error handling bogus if machine image location is wrong #23148

Closed
cr1st1p opened this issue Apr 28, 2015 · 2 comments
Closed

virt - error handling bogus if machine image location is wrong #23148

cr1st1p opened this issue Apr 28, 2015 · 2 comments
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P4 Priority 4 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@cr1st1p
Copy link

cr1st1p commented Apr 28, 2015

modules/virt.py and then runners/virt.py have the issue that if you give an invalid image location, they do not fail/complain as they should.

Assume you run a command like below, where it is [hopefully] clear that the image location is wrong:

salt-run virt.init ubuntu_vivid2 1 512 salt://vivid-server-cloudimg-amd64-disk1.im
Searching for Hypervisors
Minion will be preseeded
Creating VM ubuntu_vivid2 on hypervisor home-bigbro
VM ubuntu_vivid2 initialized on hypervisor home-bigbro

Of course, no vm is created.
Salt version (master and minion): 2014.7.5; on openSuse.

Issue seems to come from modules/virt.py not saying anything about the error (if you use it inside a state, you'll get the state failed but without any other information), and runners/virt.py which does not look very well at the returned data.

I'll try to do a pull request for a fix soon.

cr1st1p pushed a commit to cr1st1p/salt that referenced this issue Apr 28, 2015
@cr1st1p
Copy link
Author

cr1st1p commented Apr 28, 2015

Without the code changes, if called inside a salt state you get the state errored like:

          ID: vm_ubuntu_install
    Function: module.run
        Name: virt.init
      Result: False
     Comment: Module function virt.init executed
     Started: 00:10:05.859917
    Duration: 1021.045 ms
     Changes:

With code changes applied you get:

salt-run virt.init ubuntu_vivid2 1 512 salt://vivid-server-cloudimg-amd64-disk1.im
Searching for Hypervisors
Minion will be preseeded
Creating VM ubuntu_vivid2 on hypervisor home-bigbro
VM ubuntu_vivid2 initialization failed. Returned error: ERROR: problem copying image. salt://vivid-server-cloudimg-amd64-disk1.im - [Errno 2] No such file or directory:

And as salt state:

          ID: vm_ubuntu_install
    Function: module.run
        Name: virt.init
      Result: False
     Comment: Module function virt.init threw an exception. Exception: problem copying image. salt://images/vivid-server-cloudimg-amd64-disk1.im - [Errno 2] No such file or directory:
     Started: 00:05:10.585440
    Duration: 1156.835 ms
     Changes:

@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Salt-Cloud P4 Priority 4 labels Apr 28, 2015
@jfindlay jfindlay added this to the Approved milestone Apr 28, 2015
@jfindlay jfindlay added the fixed-pls-verify fix is linked, bug author to confirm fix label Apr 28, 2015
@jfindlay
Copy link
Contributor

@cr1st1p, thanks for reporting and fixing.

@jfindlay jfindlay added RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. and removed RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. labels Jun 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P4 Priority 4 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

3 participants