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

Command to set max-volume-size for vmgroup fails if size is specified as string #1409

Closed
ashahi1 opened this issue Jun 13, 2017 · 2 comments
Closed

Comments

@ashahi1
Copy link
Contributor

ashahi1 commented Jun 13, 2017

Steps:

  1. Setup only had _DEFAULT tenant.
  2. Set --volume-maxsize for _DEFAULT tenant to 2GB
  3. Then tried to revert the --volume-maxsize to the way it was - revert it back to Unset.
    Basically I again wanted to make volume-maxsize as unlimited for _DEFAULT tenant - Failed.

Ideally, we shouldn't see a stack trace if a particular command fails.

===================

Steps and their output are as follows:

  1. Setup only had _DEFAULT tenant.
[root@sc-rdops-vm04-dhcp-100-33:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py vmgroup access ls --name=_DEFAULT
Datastore  Allow_create  Max_volume_size  Total_size
---------  ------------  ---------------  ----------
_ALL_DS    True          Unset            Unset
_VM_DS     True          Unset            Unset

[root@sc-rdops-vm04-dhcp-100-33:~]
  1. Set --volume-maxsize for _DEFAULT tenant to 2GB
[root@sc-rdops-vm04-dhcp-100-33:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py vmgroup access set --name=_DEFAULT --datastore=_VM_DS --allow-create=True --volume-maxsize=2GB
vmgroup access set succeeded
[root@sc-rdops-vm04-dhcp-100-33:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py vmgroup access ls --name=_DEFAULT
Datastore  Allow_create  Max_volume_size  Total_size
---------  ------------  ---------------  ----------
_ALL_DS    True          Unset            Unset
_VM_DS     True          2.00GB           Unset

[root@sc-rdops-vm04-dhcp-100-33:~]
  1. Tried to revert the --volume-maxsize to the way it was - revert it back to Unset.
[root@sc-rdops-vm04-dhcp-100-33:~] /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py vmgroup access set --name=_DEFAULT --datastore=_VM_DS --allow-create=True --volume-maxsize=Unset
Traceback (most recent call last):
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 1406, in <module>
    main()
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 61, in main
    args.func(args)
  File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 1083, in tenant_access_set
    volume_maxsize_in_MB = convert.convert_to_MB(args.volume_maxsize)
  File "/usr/lib/vmware/vmdkops/Python/convert.py", line 27, in convert_to_MB
    value = int(vol_size_str[:-2])
ValueError: invalid literal for int() with base 10: 'Uns'
[root@sc-rdops-vm04-dhcp-100-33:~]

@ashahi1 ashahi1 added this to the 0.16 milestone Jun 13, 2017
@lipingxue lipingxue self-assigned this Jun 13, 2017
@ashahi1 ashahi1 changed the title Command to set max-volume-size for vmgroup fails if string is specified as size Command to set max-volume-size for vmgroup fails if size is specified as string Jun 13, 2017
@shaominchen shaominchen modified the milestones: 0.17, 0.16 Jun 20, 2017
@tusharnt tusharnt removed this from the 0.17 milestone Jul 18, 2017
@govint govint added the mustfix label Sep 28, 2017
@govint
Copy link
Contributor

govint commented Sep 28, 2017

Setting mustfix because this is causing a code exception for user input which has to be fixed.

@tusharnt tusharnt added P0 and removed P1 labels Oct 2, 2017
@tusharnt tusharnt assigned govint and unassigned lipingxue Oct 2, 2017
@govint
Copy link
Contributor

govint commented Oct 9, 2017

This issue was fixed via #1383 a day after this issue was filed :-). Closing

@govint govint closed this as completed Oct 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants