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

ESX Admin CLI vmdkops_admin.py 'ls' and 'status' TypeError #633

Closed
marksoper opened this issue Oct 19, 2016 · 8 comments
Closed

ESX Admin CLI vmdkops_admin.py 'ls' and 'status' TypeError #633

marksoper opened this issue Oct 19, 2016 · 8 comments

Comments

@marksoper
Copy link
Contributor

VIB details

Version: b'0.7.93a0739-0.0.1' - a docker-volume-vsphere vib I built myself (includes the UI plugin)

ESX details
Version:
1.8.0
Build number:
4382553
ESXi version:
6.5.0
ESXi build number:
4496391

vmdkops_admin.py ls

[root@localhost:/tmp/docker-volume-vsphere] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Traceback (most recent call last):
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 643, in
main()
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 40, in main
args.func(args)
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 355, in ls
print(cli_table.create(header, rows))
File "/usr/lib/vmware/vmdkops/Python/cli_table.py", line 37, in create
header = truncate([header], sizes)[0]
File "/usr/lib/vmware/vmdkops/Python/cli_table.py", line 177, in truncate
truncated_row.append(column[:size - 2] + '..')
TypeError: slice indices must be integers or None or have an index method
[root@localhost:/tmp/docker-volume-vsphere]

vmdkops_admin.py status

[root@localhost:/tmp/docker-volume-vsphere] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py status
Version: b'0.7.93a0739-0.0.1'
Traceback (most recent call last):
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 643, in
main()
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 40, in main
args.func(args)
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 555, in status
(status, pid) = get_service_status()
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 594, in get_service_status
pid = output[3].split("=")[1]
TypeError: a bytes-like object is required, not 'str'

@andrewjstone
Copy link
Contributor

May I suggest adding regression tests that invoke these commands from the CLI to whomever fixes this bug. I actually thought they already existed...

@marksoper
Copy link
Contributor Author

I tried this and confirmed same outcome with the current download VIB at https://github.com/vmware/docker-volume-vsphere/releases/download/0.7/vmware-esx-vmdkops-0.7.vib

@pdhamdhere
Copy link
Contributor

@govint Can you please take a look?

@govint
Copy link
Contributor

govint commented Oct 21, 2016

This is what I'm getting, with the current code. @marksoper can you give access to your host so I can debug this.


[root@localhost:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume Datastore Created By VM Created Attached To VM Policy Capacity Used Filesystem Type Access Attach As


VmdkAttachDetachTestVol1 datastore1 test-vm Thu Oct 20 06:48:58 2016 detached N/A 100.00MB 0B N/A read-write independent_persistent
VmdkAttachDetachTestVol2 datastore1 test-vm Thu Oct 20 06:48:58 2016 detached N/A 100.00MB 0B N/A read-write independent_persistent
VmdkAttachDetachTestVol3 datastore1 test-vm Thu Oct 20 06:48:59 2016 detached N/A 100.00MB 0B N/A read-write independent_persistent
VmdkAttachDetachTestVol4 datastore1 test-vm Thu Oct 20 06:49:00 2016 detached N/A 100.00MB 0B N/A read-write independent_persistent
...


[root@localhost:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py status
Version: b'0.7.ef3ff0f-0.0.1'
Status: Stopped
LogConfigFile: /etc/vmware/vmdkops/log_config.json
LogFile: /var/log/vmware/vmdk_ops.log
LogLevel: INFO


@govint
Copy link
Contributor

govint commented Oct 21, 2016

With the vib on the repo status fails like @marksoper described. ls still works ok


esxcli software vib list|grep vmdk
esx-vmdkops-service 1.0.0-0.0.1 VMWare PartnerSupported 2016-10-21



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


VmdkAttachDetachTestVol1 datastore1 test-vm Thu Oct 20 06:48:58 2016 detached N/A 100.00MB 0B N/A read-write independent_persistent
VmdkAttachDetachTestVol2 datastore1 test-vm Thu Oct 20 06:48:58 2016 detached N/A 100.00MB 0B N/A read-write independent_persistent
VmdkAttachDetachTestVol3 datastore1 test-vm Thu Oct 20 06:48:59 2016 detached N/A 100.00MB 0B N/A read-write independent_persistent
...


/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py status
Version: b'1.0.0-0.0.1'
Traceback (most recent call last):
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 638, in
main()
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 40, in main
args.func(args)
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 555, in status
(status, pid) = get_service_status()
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 589, in get_service_status
pid = output[3].split("=")[1]


@govint
Copy link
Contributor

govint commented Oct 25, 2016

PR #641 fixes the error for the status command,.

@govint
Copy link
Contributor

govint commented Oct 25, 2016

This is what I'm getting, with the current code. @markspoer can you give
access to your host so I can debug this.


[root@localhost:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Volume Datastore Created By VM Created
Attached To VM Policy Capacity Used Filesystem Type
Access Attach As




VmdkAttachDetachTestVol1 datastore1 test-vm Thu Oct 20
06:48:58 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol2 datastore1 test-vm Thu Oct 20
06:48:58 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol3 datastore1 test-vm Thu Oct 20
06:48:59 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol4 datastore1 test-vm Thu Oct 20
06:49:00 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol5 datastore1 test-vm Thu Oct 20
06:49:01 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol6 datastore1 test-vm Thu Oct 20
06:49:02 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol7 datastore1 test-vm Thu Oct 20
06:49:02 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol8 datastore1 test-vm Thu Oct 20
06:49:03 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol9 datastore1 test-vm Thu Oct 20
06:49:04 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol10 datastore1 test-vm Thu Oct 20
06:49:05 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol11 datastore1 test-vm Thu Oct 20
06:49:05 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol12 datastore1 test-vm Thu Oct 20
06:49:06 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol13 datastore1 test-vm Thu Oct 20
06:49:07 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol14 datastore1 test-vm Thu Oct 20
06:49:08 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol15 datastore1 test-vm Thu Oct 20
06:49:09 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol16 datastore1 test-vm Thu Oct 20
06:49:09 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol17 datastore1 test-vm Thu Oct 20
06:49:10 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol18 datastore1 test-vm Thu Oct 20
06:49:11 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol19 datastore1 test-vm Thu Oct 20
06:49:12 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol20 datastore1 test-vm Thu Oct 20
06:49:13 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol21 datastore1 test-vm Thu Oct 20
06:49:13 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol22 datastore1 test-vm Thu Oct 20
06:49:14 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol23 datastore1 test-vm Thu Oct 20
06:49:15 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol24 datastore1 test-vm Thu Oct 20
06:49:16 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol25 datastore1 test-vm Thu Oct 20
06:49:17 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol26 datastore1 test-vm Thu Oct 20
06:49:17 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
VmdkAttachDetachTestVol27 datastore1 test-vm Thu Oct 20
06:49:18 2016 detached N/A 100.00MB 0B N/A
read-write independent_persistent
dvol_2 bigone 2 Tue Aug 2
04:49:32 2016 detached N/A 100.00MB 14.00MB N/A
read-only independent_persistent
dvol_3 bigone 2 Wed Aug 3
05:14:12 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
dvol_4 bigone 2 Wed Aug 3
05:14:15 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
dvol_5 bigone 2 Thu Aug 4
04:24:38 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
hvol_s1 bigone Ubuntu-14.04-64 (2) Thu Aug 4
06:44:55 2016 Ubuntu-14.04-64 N/A 10.00GB 4.52GB N/A
read-write independent_persistent
dvol_6 bigone 2 Thu Aug 4
07:28:35 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
hvol_s2 bigone Ubuntu-14.04-64 (2) Thu Aug 4
09:11:35 2016 Ubuntu-14.04-64 N/A 10.00GB 9.72GB N/A
read-write independent_persistent
hvol_s3 bigone Ubuntu-14.04-64 (2) Thu Aug 4
09:11:59 2016 Ubuntu-14.04-64 N/A 10.00GB 6.66GB N/A
read-write independent_persistent
hvol_m bigone Ubuntu-14.04-64 (2) Thu Aug 4
11:34:33 2016 Ubuntu-14.04-64 N/A 10.00GB 4.67GB N/A
read-write independent_persistent
newvol157 bigone 2 Tue Aug 16
06:21:57 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
newvol155 bigone 1 Tue Aug 16
06:19:20 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
v14 bigone 2 Thu Oct 13
05:58:58 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
test-vol-label-2 bigone 2 Fri Sep 23
11:50:06 2016 detached N/A 100.00MB 14.00MB N/A
read-write independent_persistent
svc-vol bigone 2 Fri Sep 16
08:49:38 2016 detached N/A 10.00GB 251.00MB N/A
read-write independent_persistent
vSlave1 bigone volumestats Wed Sep 7
11:51:29 2016 detached N/A 10.00GB 3.35GB N/A
read-write independent_persistent
vSlave2 bigone volumestats Wed Sep 7
11:51:44 2016 detached N/A 10.00GB 3.37GB N/A
read-write independent_persistent
vol_master bigone New Virtual Machine Tue Sep 6
10:14:25 2016 detached N/A 10.00GB 270.00MB N/A
read-write independent_persistent
vol_slave2 bigone New Virtual Machine Tue Sep 6
10:19:49 2016 detached N/A 10.00GB 274.00MB N/A
read-write independent_persistent
vol_slave1 bigone New Virtual Machine Tue Sep 6
10:45:58 2016 detached N/A 10.00GB 273.00MB N/A
read-write independent_persistent
vMaster bigone volumestats Wed Sep 7
11:51:14 2016 detached N/A 10.00GB 497.00MB N/A
read-write independent_persistent
new-vol-100 bigone 2 Thu Oct 20
16:05:48 2016 detached N/A 100.00MB 13.00MB ext4
read-write independent_persistent


[root@localhost:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py status
Version: b'0.7.ef3ff0f-0.0.1'
Status: Stopped
LogConfigFile: /etc/vmware/vmdkops/log_config.json
LogFile: /var/log/vmware/vmdk_ops.log
LogLevel: INFO


On Fri, Oct 21, 2016 at 6:32 AM, Prashant Dhamdhere <
notifications@github.com> wrote:

Assigned #633 #633
to @govint https://github.com/govint.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#633 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/APHseNyjGpDetbvd8fl3SF-IRoy1KMeIks5q2A8LgaJpZM4KbTwC
.

@pdhamdhere
Copy link
Contributor

Fixed with #641

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

No branches or pull requests

4 participants