Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Docker volume service handles connection issues with host agent. #1000

Merged
merged 2 commits into from
Mar 9, 2017

Conversation

govint
Copy link
Contributor

@govint govint commented Mar 7, 2017

Testing:

  1. Stop hostd
  2. Issue docker volume create on client.
  3. Service returns error

Continues till hostd is started and its ready to accept login requests.

Logs:
$ docker volume create -d vsphere 2222
Error response from daemon: create 2222: VolumeDriver.Create: Service is presently unavailable, ensure the ESX Host Agent is running on this host

$ docker volume create -d vsphere 2222
Error response from daemon: create 2222: VolumeDriver.Create: Service is presently unavailable, ensure the ESX Host Agent is running on this host

$ docker volume create -d vsphere 2222
2222

Admin CLI:
/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Unable to connect to the host-agent on this host, ensure the ESX host agent is running before retrying.

/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Unable to connect to the host-agent on this host, ensure the ESX host agent is running before retrying.

/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume Datastore Created By VM Created Attached To VM (name/uuid) Policy Capacity Used Disk Format Filesystem Type Access Attach As


vsp bigone 2 Wed Feb 22 08:59:12 2017 detached N/A 100MB 13MB thin ext4 read-write independent_persistent
vsp1 bigone 2 Wed Feb 22 09:21:30 2017 detached N/A 100MB 13MB thin ext4 read-write independent_persistent
vsp2 bigone 2 Wed Feb 22 09:21:59 2017 detached N/A 100MB 13MB thin ext4 read-write independent_persistent
vsp3 bigone 2 Thu Feb 23 04:51:17 2017 detached N/A 10GB 145MB thin ext4 read-write independent_persistent
vsp5 bigone 2 Thu Feb 23 08:38:46 2017 detached N/A 10GB 145MB thin ext4 read-write independent_persistent
vsp6 bigone 2 Thu Feb 23 08:40:43 2017 detached N/A 10GB 145MB thin ext4 read-write independent_persistent
vsp7 bigone 2 Thu Feb 23 08:42:12 2017 detached N/A 10GB 145MB thin ext4 read-write independent_persistent
vsp10 bigone 2 Thu Feb 23 08:42:34 2017 detached N/A 10GB 145MB thin ext4 read-write independent_persistent
vsp11 bigone 2 Thu Feb 23 08:54:52 2017 detached N/A 10GB 145MB thin ext4 read-write independent_persistent
vvol bigone 2 (1) Mon Mar 6 05:18:59 2017 detached N/A 100MB 13MB thin ext4 read-write independent_persistent
nnnn bigone 2 Mon Mar 6 18:14:04 2017 detached N/A 100MB 13MB thin ext4 read-write independent_persistent
2222 bigone 2 Tue Mar 7 04:02:55 2017 detached N/A 100MB 13MB thin ext4 read-write independent_persistent

Copy link
Contributor

@shaominchen shaominchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A few nits. Please resolve CI failure before merging.

@@ -46,6 +46,8 @@
def main():
log_config.configure()
kv.init()
if not vmdk_ops.is_service_available():
sys.exit('Unable to connect to the host-agent on this host, ensure the ESX host agent is running before retrying.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "ESX host agent" => "ESXi Host Agent"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So do we exit it here, but do not exit in connectLocalSi() ? I think it's OK for the service to either poll for hostd being up (and wait), or we should exit and have init.d take care of restarts, but why both ?

Copy link
Contributor Author

@govint govint Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the admin CLI code, if Hostd is down then admin CLI errors out as below,

/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Unable to connect to the host-agent on this host, ensure the ESX host agent is running before retrying.

The volume service doesn't exit and instead runs and keep retrying the connect to hostd on every command till its able to get a connect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes. Sorry I should have paid more attention to file names :-)

No more issues then. LGTM

@@ -1470,6 +1474,13 @@ def handleVmciRequests(port):
skip_count = MAX_SKIP_COUNT # reset the counter, just in case

client_socket = c # Bind to avoid race conditions.

if not get_si():
svc_connect_err = 'Service is presently unavailable, ensure the ESX Host Agent is running on this host'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "ESX" => "ESXi"

@msterin
Copy link
Contributor

msterin commented Mar 7, 2017

Nice adding of the reply back (on hostd being down). But I do not undertand why do we need exit on start (if there is no connection) ? It will simply lead to init.d restarting the service, will it not ?

Copy link
Contributor

@pdhamdhere pdhamdhere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@govint govint merged commit 7336921 into master Mar 9, 2017
@govint govint deleted the svc-init branch March 9, 2017 03:52
@govint
Copy link
Contributor Author

govint commented Mar 9, 2017

CI failure is issue in handling the issue reported in #941

@pdhamdhere
Copy link
Contributor

Fixes #976

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants