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

error 1: invalid value "us-central" for flag -linode-datacenter-id: strconv.ParseInt: parsing "us-central": invalid syntax #9

Open
optimum-web opened this issue Jun 29, 2018 · 15 comments

Comments

@optimum-web
Copy link

Hi,

Command was: ['docker-machine', 'create', '--driver=linode', '--linode-label', 'mautic-linode.com', '--linode-api-key', '', '--linode-root-pass', '**', '--linode-datacenter-id', 'us-central', '--linode-distribution-id', 'linode/ubuntu18.04', '--linode-plan-id', 'g6-nanode-1', 'mautic-linode.com']

error 1: invalid value "us-central" for flag -linode-datacenter-id: strconv.ParseInt: parsing "us-central": invalid syntax

Linode is updating their API so that could cause the issue ?

@displague
Copy link

@optimum-web This provider is based on Linode APIv3, https://www.linode.com/api/ .

The plans and datacenter are specified differently, as a single integer ID that represents the plan, the distribution, and the region.

I plan on updating this provider for APIv4 support. The parameters will be renamed but the values will accept the values that you provided.

I'll follow-up with a link to my fork when ready.

@trydirect
Copy link

Thanks !

@optimum-web
Copy link
Author

Sounds good.

@displague
Copy link

I have yet to try this myself, but this is my start at it. displague#5

If you are able to build this and give it a shot, let me know if it works (or offer some pulls) :-)

I built against the "nodebalancers" branch of https://github.com/displague/lindodego .. My pull request for that is here, linode/linodego#18

I'll revisit this later today or tomorrow.

@displague
Copy link

Well, it works -- at least as well as, and all credit to, this project.

https://github.com/displague/docker-machine-linode

Give it a shot!

@optimum-web
Copy link
Author

@displague getting errors on go get github.com/displague/docker-machine-linode

root@fa1a672dd126:/app# go get github.com/displague/docker-machine-linode
# github.com/displague/docker-machine-linode
/root/go/src/github.com/displague/docker-machine-linode/linode.go:213:11: unknown field 'SwapSize' in struct literal of type linodego.InstanceCreateOptions
/root/go/src/github.com/displague/docker-machine-linode/linode.go:245:12: undefined: linodego.WaitForInstanceStatus
/root/go/src/github.com/displague/docker-machine-linode/linode.go:245:65: undefined: linodego.InstanceRunning
/root/go/src/github.com/displague/docker-machine-linode/linode.go:271:7: undefined: linodego.InstanceRunning
/root/go/src/github.com/displague/docker-machine-linode/linode.go:273:7: undefined: linodego.InstanceOffline
/root/go/src/github.com/displague/docker-machine-linode/linode.go:274:3: undefined: linodego.InstanceRebuilding
/root/go/src/github.com/displague/docker-machine-linode/linode.go:275:3: undefined: linodego.InstanceMigrating
/root/go/src/github.com/displague/docker-machine-linode/linode.go:277:7: undefined: linodego.InstanceShuttingDown
/root/go/src/github.com/displague/docker-machine-linode/linode.go:277:38: undefined: linodego.InstanceDeleting
/root/go/src/github.com/displague/docker-machine-linode/linode.go:279:7: undefined: linodego.InstanceProvisioning
/root/go/src/github.com/displague/docker-machine-linode/linode.go:279:7: too many errors

@displague
Copy link

displague commented Jul 9, 2018

@optimum-web go get -u github.com/displague/docker-machine-linode

I was building against a branch of https://github.com/chiefy/linodego that hadn't been merged. It has since been merged.

Also, I built some binaries: https://github.com/displague/docker-machine-linode/releases

@optimum-web
Copy link
Author

Perfect ! It worked fine. Only one thing remains is to change documentation table: flag provided but not defined: -linode-instance-type , it should be -linode-type, check https://github.com/displague/docker-machine-linode

@displague
Copy link

displague commented Jul 10, 2018

I may actually rename it to -linode-instance-type after all. I'm running this in Rancher and Rancher's UI code is sensitive about the name type.

Better to rename it now when there are only two users!

@optimum-web
Copy link
Author

Yeah, done it. Testing today one more time.

@trydirect
Copy link

Almost working.. machine has been created at linode but provisioning failed.
type: g6-nanode-1
image: "linode/ubuntu16.04lts"

Running pre-create checks...
Creating machine...
(linode-opencart.com) Creating Linode machine instance...
(linode-opencart.com) Creating linode instance
(linode-opencart.com) Waiting for Machine Running...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Error creating machine: Error running provisioning: ssh command error:
command : sudo systemctl -f start docker
err : exit status 1
output : Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

The default lines below are for a sh/bash shell, you can specify the shell you're using, with the --shell flag.

@displague
Copy link

displague commented Jul 11, 2018

@trydirect I noticed that too -- I updated the default image to linode/ubuntu18.04 because it worked when linode/ubuntu16.04lts did not. I received the same sort of error when I tried to use linode/debian9 as the default image.

go get -u github.com/displague/docker-machine-linode and try again (now v0.0.2), or if you were running with -linode-image try linode/ubuntu18.04. Also note, -linode-type has become -linode-instance-type.

I've opened the Issues tab on https://github.com/displague/docker-machine-linode/issues

@trydirect
Copy link

well .. yes, but that does not fix the problem with ubuntu early versions.

@optimum-web
Copy link
Author

optimum-web commented Jul 12, 2018

Machine created successfully but can not connect it via SSH.
root@18fe69a5bb42:/app# docker-machine ssh linode-suite.com
exit status 255
image: ubuntu 18.04

@displague
Copy link

@optimum-web What does docker-machine ls report? (We should really take this issue over to github.com/displague/docker-machine-linode/issues)

$  docker-machine ls
docker-machineNAME                    ACTIVE   DRIVER   STATE     URL                        SWARM   DOCKER        ERRORS
linode-ubuntu18.04      -        linode   Running   tcp://45.79.172.231:2376           v18.05.0-ce
linode                           linode   Timeout
linode-containerlinux   -        linode   Running   tcp://45.79.158.67:2376            Unknown       Unable to query docker version: Cannot connect to the docker engine endpoint

$ docker-machine ssh linode-ubuntu18.04
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-20-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Thu Jul 12 13:14:41 UTC 2018

  System load:  0.49               Processes:              271
  Usage of /:   2.3% of 156.99GB   Users logged in:        0
  Memory usage: 13%                IP address for eth0:    45.79.172.231
  Swap usage:   0%                 IP address for docker0: 172.17.0.1

  => There are 150 zombie processes.

 * Introducing Minimal Ubuntu for docker and clouds. 30 MB base image and
   optimised kernels on public clouds. Made for machines and containers.

   - https://bit.ly/minimal-ubuntu

 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch

113 packages can be updated.
54 updates are security updates.


root@flowers:~#

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

2 participants