scaleway/scaleway-cli

Add an interactive mode to scw run

NoKriK opened this issue · 4 comments

By default, scw run doesn't give any feedback.
When used in scripts, it's a nice behaviour but when used interactively it's frustrating.
The boot process can take up to a minute and it would be nice to have feedback telling that orders are going through.

It would be nice to have a verbose mode telling in a human readable way where we are in the boot process.

moul commented

try scw -D run ..., -D == --debug

Thanks, I already found and tried that!
This is a little bit more verbose than what I except, I'm looking at something which shows that the command isn't stuck.

Something like a -V option which would give:

Server creation requested.. ok
Server start requested... ok
Server is starting, this may take up to a minute...
Server changed state to "booting kernel"
Server changed state to "kernel booted"
Server is ready!
moul commented

Ok, got it

moul commented
$ scw -V run alpine
INFO[0000] Server creation ...
INFO[0001] Server created: 0531442f-17bc-49d3-87fc-ab6744822859
INFO[0001] Server start requested ...
INFO[0002] Server is starting, this may take up to a minute ...
INFO[0003] Server changed state to 'starting'
INFO[0051] Server changed state to 'running'
INFO[0055] Server is ready !
INFO[0055] Connecting to server ...
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org>.

You may change this message by editing /etc/motd.

lonely-tesla:~#

$ scw -D run alpine
INFO[0000] Server creation ...
DEBU[0000] POST https://api.scaleway.com/servers payload={"name":"grave-leakey","image":"4e393543-bcf0-4e44-88ee-db786256bc66","dynamic_ip_required":true,"bootscript":null,"organization":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX"}
DEBU[0000] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0001] PUT https://api.scaleway.com/volumes/c7f13c23-59f0-4b76-a62b-764033250142 payload={"id":"c7f13c23-59f0-4b76-a62b-764033250142","size":50000000000,"creation_date":"2015-08-03T08:50:05.857161+00:00","modification_date":"2015-08-03T08:50:05.857161+00:00","organization":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX","name":"grave-leakey-scw-distrib-alpine-latest-2015-06-19_17:09","server":{"id":"7aa02b9d-5f07-4164-958e-287f999b9c59","name":"grave-leakey"},"volume_type":"l_ssd","export_uri":""}
INFO[0001] Server created: 7aa02b9d-5f07-4164-958e-287f999b9c59
INFO[0001] Server start requested ...
DEBU[0001] POST https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59/action payload={"action":"poweron"}
INFO[0004] Server is starting, this may take up to a minute ...
DEBU[0004] Waiting for server to be ready
DEBU[0004] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
INFO[0005] Server changed state to 'starting'
DEBU[0006] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0007] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0009] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0011] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0012] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0014] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0015] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0017] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0018] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0020] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0021] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0023] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0024] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0026] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0027] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0029] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0031] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0032] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0034] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0035] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0037] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0038] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0040] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0041] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0043] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0044] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0046] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0047] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0049] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
DEBU[0050] GET https://api.scaleway.com/servers/7aa02b9d-5f07-4164-958e-287f999b9c59
INFO[0051] Server changed state to 'running'
DEBU[0051] Waiting for server SSH port
DEBU[0051] SSH server is available: 212.47.239.176:22
INFO[0051] Server is ready !
INFO[0051] Connecting to server ...
DEBU[0051] Executing: ssh  "-o" "UserKnownHostsFile=/dev/null" "-o" "StrictHostKeyChecking=no" "-l" "root" "212.47.239.176" "-t" "-t"
Warning: Permanently added '212.47.239.176' (RSA) to the list of known hosts.
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org>.

You may change this message by editing /etc/motd.

grave-leakey:~#

$ scw run alpine
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org>.

You may change this message by editing /etc/motd.

focused-lovelace:~#