-
Notifications
You must be signed in to change notification settings - Fork 95
Docker volume service handles connection issues with host agent. #1000
Conversation
There was a problem hiding this 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.
esx_service/cli/vmdkops_admin.py
Outdated
@@ -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.') |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
esx_service/vmdk_ops.py
Outdated
@@ -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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "ESX" => "ESXi"
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 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI failure is issue in handling the issue reported in #941 |
Fixes #976 |
Testing:
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