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

Admin cli command to list volume fails #972

Closed
ashahi1 opened this issue Feb 25, 2017 · 4 comments · Fixed by #985
Closed

Admin cli command to list volume fails #972

ashahi1 opened this issue Feb 25, 2017 · 4 comments · Fixed by #985

Comments

@ashahi1
Copy link
Contributor

ashahi1 commented Feb 25, 2017

Admin Cli command to list volume fails.

Steps:

  1. Created a volume named volume1
root@photon-xVmYMbyTn [ ~ ]# docker volume create --driver=vmdk --name=volume1 -o size=500mb
volume1
root@photon-xVmYMbyTn [ ~ ]# docker volume inspect volum1
[]
Error: No such volume: volum1
root@photon-xVmYMbyTn [ ~ ]# docker volume inspect volume1
[
    {
        "Name": "volume1",
        "Driver": "vmdk",
        "Mountpoint": "/mnt/vmdk/volume1",
        "Status": {
            "access": "read-write",
            "attach-as": "independent_persistent",
            "capacity": {
                "allocated": "23MB",
                "size": "500MB"
            },
            "clone-from": "None",
            "created": "Sat Feb 25 23:03:11 2017",
            "created by VM": "photon-VM0.3",
            "datastore": "sharedVmfs-0",
            "diskformat": "thin",
            "fstype": "ext4",
            "status": "detached"
        },
        "Labels": {},
        "Scope": "global"
    }
]
root@photon-xVmYMbyTn [ ~ ]#
  1. Tried to verify volume details on esx using admin cli command - unsuccessful.
[root@sc2-rdops-vm01-dhcp-32-255:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Traceback (most recent call last):
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 1011, in <module>
    main()
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 51, in main
    args.func(args)
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 508, in ls
    print(cli_table.create(header, rows))
  File "/usr/lib/vmware/vmdkops/Python/cli_table.py", line 33, in create
    max_sizes = max_column_sizes(header, data)
  File "/usr/lib/vmware/vmdkops/Python/cli_table.py", line 157, in max_column_sizes
    if len(row[i]) > sizes[i]:
TypeError: object of type 'int' has no len()
[root@sc2-rdops-vm01-dhcp-32-255:~]
@ashahi1 ashahi1 added this to the 0.12 milestone Feb 25, 2017
@ashahi1
Copy link
Contributor Author

ashahi1 commented Feb 25, 2017

//CC @pdhamdhere @tusharnt

@ashahi1
Copy link
Contributor Author

ashahi1 commented Feb 26, 2017

Not able to repro the issue. Closing it.

@ashahi1 ashahi1 closed this as completed Feb 26, 2017
@pshahzeb
Copy link
Contributor

pshahzeb commented Mar 1, 2017

Reproduced this.

Just tried admin ls command when no volume, tenant etc has been created.

[root@sc-rdops-vm16-dhcp-230-73:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls
Traceback (most recent call last):
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 1011, in <module>
    main()
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 51, in main
    args.func(args)
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 509, in ls
    print(cli_table.create(header, rows))
  File "/usr/lib/vmware/vmdkops/Python/cli_table.py", line 33, in create
    max_sizes = max_column_sizes(header, data)
  File "/usr/lib/vmware/vmdkops/Python/cli_table.py", line 157, in max_column_sizes
    if len(row[i]) > sizes[i]:
TypeError: object of type 'int' has no len()

But other commands do work. e.g. tenant ls

[root@sc-rdops-vm16-dhcp-230-73:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py tenant ls
Uuid                                  Name      Description               Default_datastore  VM_list
------------------------------------  --------  ------------------------  -----------------  -------
11111111-1111-1111-1111-111111111111  _DEFAULT  This is a default tenant

Created some volumes and then tried admin ls command. But facing the same error as above.
Although the following command worked.

[root@sc-rdops-vm16-dhcp-230-73:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py ls -c volume,capacity
Volume       Capacity
-----------  --------
vol_test_1   200MB
vol_test_2   200MB
vol_test_33  200MB

Attaching vmdk_ops log as well.
vmdk_ops.txt

@pshahzeb pshahzeb reopened this Mar 1, 2017
@pshahzeb
Copy link
Contributor

pshahzeb commented Mar 1, 2017

The error still exists after uninstalling and installing the vib again

msterin pushed a commit that referenced this issue Mar 1, 2017
Fixes #972

When the value (e.g. of UsedSize) was < 1KB, the convert returned int instead of str
and that broke the logic of CLI table size estimate
@shuklanirdesh82 shuklanirdesh82 modified the milestones: 0.13, 0.12 Mar 2, 2017
msterin pushed a commit that referenced this issue Mar 2, 2017
Fixes #972

When the value (e.g. of UsedSize) was < 1KB, the convert returned int instead of str
and that broke the logic of CLI table size estimate
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants