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

Connect to existing instance #51

Open
antetna opened this issue Mar 14, 2015 · 3 comments
Open

Connect to existing instance #51

antetna opened this issue Mar 14, 2015 · 3 comments

Comments

@antetna
Copy link

antetna commented Mar 14, 2015

I already have VPS instance with SoftLayer. Is it possible to use that isntance with Vagrant ?
If I issue vagrant up it provisions new instance but I would like to connect existing instance ?

==> default: The SoftLayer instance is not running. Please run vagrant up first.

@ju2wheels
Copy link
Contributor

Theres currently no automated way to do this, I have to double check but off the top of my head I think you would have to manually create the Vagrant state files which IIRC should contain the server ID in it and then also create a Vagrant file matching the settings of what the server currently is in order to be able to do this. I wont be able to take a further look at this probably until end of the week or weekend to provide further details, but check the following:

  1. Each Vagrantfile creates a .vagrant dir in the CWD, normally the same folder as the Vagrantfile or in the path specified by environment variable VAGRANT_DOTFILE_PATH. There should be some state files under there one of which should contain the server id (dont know the structure/format of the files as i dont have any up right now). You would need to create these for each machine referencing the setup for one that you have working already.
  2. Create a standard Vagrantfile matching the configuration of the server.

@lonniev
Copy link

lonniev commented Apr 13, 2015

@ju2wheels, is it possible to connect a new vagrant instance with the clone of an SL image that was created by vagrant? That is, I vagrant up a default SL image, modify the instance to be easily managed by vagrant (e.g. add the vagrant user, the ssh key, install chocolatey, etc), have the SL portal clone the modified image, run a new vagrant session, and rather than point to a default box point to an SL image that is the clone image instead?

Does that work?

@ju2wheels
Copy link
Contributor

@lonniev, I havent created clones or tested this out but this is along the lines of what we discussed in one of the other threads, but yes it should be possible with the caveat that the new machine will have the same disk specs as the old one. What you want to do to build the clone machine is use the disk GUID of the image as opposed to building from the template that specifies OS/disk type.

Using the sl CLI tool run the following:

sl image list

Your clone machine should show up there as an image, then use the GUID listed in your config for the sl.image_guid value and omit the sl.disk_capacity and sl.operating_system values which are for building from template and determined from an image already.

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

3 participants