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

digital_ocean_v2.py doesn't restore snapshot #22724

Closed
ghost opened this issue Apr 15, 2015 · 8 comments
Closed

digital_ocean_v2.py doesn't restore snapshot #22724

ghost opened this issue Apr 15, 2015 · 8 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. fixed-pls-verify fix is linked, bug author to confirm fix RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud
Milestone

Comments

@ghost
Copy link

ghost commented Apr 15, 2015

Hey,

I'm wondering if someone can help me figure this out.

I made a snapshot of a server and I am trying to restore it via the digital_ocean_v2.py but it's not working properly.

The name of the snapshot in the example is server.example.com

Debug output of command:
salt-cloud -p server.example.com server.example.com
https://gist.github.com/ty2u/f48557e6c4bd56723f25

server.example.com profile:

server.example.com:
    provider: do
    image: server.example.com
    size: 4gb
    location: New York 3
    private_networking: True
    backups_enabled: False
    ipv6: False
    create_dns_record: True
    delete_dns_record: True

salt --versions-report

                  Salt: 2014.7.2
                Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
                Jinja2: 2.7.2
              M2Crypto: 0.21.1
        msgpack-python: 0.3.0
          msgpack-pure: Not Installed
              pycrypto: 2.6.1
               libnacl: Not Installed
                PyYAML: 3.10
                 ioflo: Not Installed
                 PyZMQ: 14.0.1
                  RAET: Not Installed
                   ZMQ: 4.0.4
                  Mako: 0.9.1
 Debian source package: 2014.7.2+ds-1trusty2

If I modify the digital_ocean_v2.py script to use the image id number instead of the name it will actually launch the server but still seems to display errors. I did this by replacing lines 226-229:

        if vm_image in (images[image]['name'], images[image]['slug'], images[image]['id']):
            if images[image]['slug'] is not None:
                return images[image]['slug']
            return int(images[image]['id'])

with

        if vm_image in (images[image]['id']):
            return int(images[image]['id'])

Furthermore, the ssh key is not valid, I think when the server has a different IP address sometimes.

@ghost
Copy link
Author

ghost commented Apr 15, 2015

Here is the output with the modification I made:
https://gist.github.com/ty2u/a398531662cf7799c180

@rallytime
Copy link
Contributor

@TY2U I suspect we just haven't implemented this kind of functionality yet, but i'm sure it can be done.

ping @techhat and @wesleylancel

@rallytime rallytime added Feature new functionality including changes to functionality and code refactors, etc. Salt-Cloud labels Apr 15, 2015
@rallytime rallytime added this to the Approved milestone Apr 15, 2015
@dmyerscough
Copy link
Contributor

I was looking into getting the snapshot functionality added soon

@ghost
Copy link
Author

ghost commented Apr 16, 2015

Yay! Thank you for the awesomeness everyone =)

@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
@systembell
Copy link
Contributor

@dmyerscough are you close to getting snapshot integration working? I can take a stab if you want.

@twangboy
Copy link
Contributor

twangboy commented Sep 8, 2015

@TY2U @Pravka @dmyerscough Did #26824 fix the issue of getting snapshots working in digital ocean?

@rallytime rallytime added the fixed-pls-verify fix is linked, bug author to confirm fix label Sep 8, 2015
@systembell
Copy link
Contributor

Works for me; salt-cloud creates droplet from a snap and uses the right ssh key. I'd still prefer for salt-cloud to be aware that private_networking is enabled and give you the option of using that to provision, but I'll be opening a separate issue for that.

@rallytime
Copy link
Contributor

@Pravka Yeah, a separate issue for the private_networking option would be great. Since this is confirmed to be working, I am going to go a head a close this. If there are any other troubles here, let us know and we can re-open. Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. fixed-pls-verify fix is linked, bug author to confirm fix RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud
Projects
None yet
Development

No branches or pull requests

5 participants