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

Cannot specify image_guid #59

Open
poflynn opened this issue May 8, 2015 · 7 comments
Open

Cannot specify image_guid #59

poflynn opened this issue May 8, 2015 · 7 comments

Comments

@poflynn
Copy link

poflynn commented May 8, 2015

It seems when I try to specify a custom image, I get this error:

There are errors in the configuration of this machine. Please fix
the following errors and try again:

SoftLayer:
* The image guid for a compute or flex image and the operating
system reference code cannot be used at the same time.
Please use only one of the following options in the provider
section:

config.vm.provider :softlayer do |sl|
  sl.image_guid = "AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE"
end

config.vm.provider :softlayer do |sl|
  sl.operating_system = "UBUNTU_LATEST"
end

I am not specifying an OS in my Vagrantfile. When I comment out my image_guid, and use an OS name instead, it works fine. I got the image GUID from the SL CLI tool. A small excerpt from my VagrantFile is below, let me know if it is too small.

    config.vm.provider :softlayer do |provider, override|
        override.vm.box = 'SoftLayer'  
        provider.box_url = 'http://xxxxx/softlayer/box/1.0/box-1.0.box'    
        provider.username = "xxxxx"
        provider.ssh_key  = "xxxxx"
        provider.api_key  = "xxxxx"
        provider.image_guid = "xxxxx"
        provider.datacenter = $vmdatacenter
        provider.domain = "xxxxx.com"
        provider.hostname = $vmhostname
        provider.api_timeout = 420
        provider.post_install = "https://xxxxx.com/repos/SoftLayer/softlayerPostInstall.sh"
        override.ssh.private_key_path = "~/.ssh/xxxxx.pem"
        override.ssh.pty = true
    end
@ju2wheels
Copy link
Contributor

This should only kick up if image_guid and disk_capacity or operating_system are defined together. Did you add those settings to your box maybe and its inheriting the values from there?:

https://github.com/audiolize/vagrant-softlayer/blob/master/lib/vagrant-softlayer/config.rb#L258-L259

Reference the Load Order and Merging at the end of the Quck Start guide.

@poflynn
Copy link
Author

poflynn commented May 8, 2015

Well, the image I created I fired up from their CentOS 5 image and immediately created an image from it (as a test). I included the default 25GB drive in it.

My .box contains one file only (metadata.json) and its contents are below.

{
    "provider": "softlayer"
}

@ju2wheels
Copy link
Contributor

Does your box include its own Vagrantfile or have you configured a user Vagrantfile to load before the one shown above?

@lonniev
Copy link

lonniev commented May 8, 2015

Also, I found that I had to explicitly unset the competing parameters. Even though I did not set a OS value in the Vagrantfile with sl.operating_system, because I used some other services like winrm, the value was getting set for me. In addition to setting the image_guid parameter, I explicitly set operating_system to nil. Then it worked.

@ju2wheels
Copy link
Contributor

Thats odd and that to me would definitely be a bug somewhere, when we initialize them its set to nil already so something else would definitely be doing it. If you use the public boxes we put up and try to use image_guid with those then those have a built in Vagrantfile that set operating_system and you would definitely need to overide the value with nil in that case or switch to the generic box.

@poflynn
Copy link
Author

poflynn commented May 8, 2015

nil worked! Cool, thanks for the tip lonniev! (provider.operating_system = nil) I had previously tried "" as I noticed it seemed to be defaulting to "UBUNTU_LATEST" but I guess one needs to be more explicit than that. I would say that this is a bug as you shouldn't need to set OS to nil if you are setting the image_guid. Thanks all.

@cromulus
Copy link

same problem here.

Thanks!

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

4 participants