scaleway / docker-machine-driver-scaleway

:whale: Scaleway driver for Docker Machine
MIT License
249 stars 34 forks source link

Error creating "Ubuntu Bionic ML" instance #102

Closed regzon closed 3 years ago

regzon commented 5 years ago

I am trying to create an instance with the following command (authentication is managed with scaleway-cli):

docker-machine create -d scaleway \
    --scaleway-name "ml-test" \
    --scaleway-image "47d58f71" \
    --scaleway-commercial-type "RENDER-S" \
    ml-test

After some time I receive this error:

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)...                                                                                                                                                                                 
Error creating machine: Error running provisioning: ssh command error:
command : sudo hostname ml-scaleway && echo "ml-scaleway" | sudo tee /etc/hostname
err     : exit status 1
output  : root is not in the sudoers file.  This incident will be reported.

Is this is a problem in the driver or in the image and how can I fix it on my side?

regzon commented 5 years ago

To clarify - I've used "Ubuntu Bionic ML 10.1" image

regzon commented 5 years ago

Probably, the problem is that a root user doesn't have sudo permissions because root is not included in /etc/sudoers or /etc/sudoers.d/. Also, the sudo group is not included there for some reason.

regzon commented 5 years ago

Looks like this is a common problem for all "Ubuntu Bionic" images. I've started a regular "Ubuntu Bionic" image on "GP1-XS" and it gave a similar error:

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)...
Error creating machine: Error running provisioning: ssh command error:
command : sudo hostname test && echo "test" | sudo tee /etc/hostname
err     : exit status 127
output  : bash: sudo: command not found
regzon commented 5 years ago

The problem is that docker-machine (in its internals) assumes that the root user can use a sudo command which is not a case in the scaleway "Ubuntu Bionic" and "Ubuntu Bionic ML 10.1" images ("Ubuntu Xenial" works fine). I'll send a ticket to the scaleway about that.

regzon commented 4 years ago

A support team didn't help me, so I've decided to give up on this - I've started using Web UI. For docker-machine, the possible solution is to create a custom image that will provide a sudo permission to the root user.