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

--size parameter in volume create CLI isn't accepting MB format #1398

Closed
atinmu opened this issue Dec 13, 2018 · 5 comments
Closed

--size parameter in volume create CLI isn't accepting MB format #1398

atinmu opened this issue Dec 13, 2018 · 5 comments
Labels
GCS/0.5 GCS 0.5 release

Comments

@atinmu
Copy link
Contributor

atinmu commented Dec 13, 2018

Observed behavior

root@b9bad6008a5e:/home/go/src/github.com/gluster/glusterd2/build# ./glustercli volume create ivp-vol1 --size=100M
Volume creation failed

Response headers:
X-Request-Id: a2c102fb-9957-4def-86dd-6e15123661f8
X-Gluster-Cluster-Id: 8d9dae2d-b422-476a-aa5d-5f7e6cb5eb1d
X-Gluster-Peer-Id: 75a41e07-8722-427c-bd8c-89e5cb694447

Response body:
invalid Volume Size, Minimum size required is 20971520

It seems the MB format in the size input isn't entertained.

Expected/desired behavior

  1. Volume create should go through
  2. Also can we mention the minimum size in (KB/MB as well) ?

Details on how to reproduce (minimal and precise)

As explained in the description

Information about the environment:

  • Glusterd2 version used (e.g. v4.1.0 or master): master
  • Operating system used:
  • Glusterd2 compiled from sources, as a package (rpm/deb), or container:
  • Using External ETCD: (yes/no, if yes ETCD version): external etcd, 3.2.2
  • If container, which container image:
  • Using kubernetes, openshift, or direct install:
  • If kubernetes/openshift, is gluster running inside kubernetes/openshift or outside:

Other useful information

  • glusterd2 config files from all nodes (default /etc/glusterd2/glusterd2.toml)
  • glusterd2 log files from all nodes (default /var/log/glusterd2/glusterd2.log)
  • ETCD configuration
  • Contents of uuid.toml from all nodes (default /var/lib/glusterd2/uuid.toml)
  • Output of statedump from any one of the node

Useful commands

  • To get glusterd2 version
    glusterd2 --version
    
  • To get ETCD version
    etcd --version
    
  • To get output of statedump
    curl http://glusterd2-IP:glusterd2-Port/statedump
    
@atinmu atinmu changed the title --size parameter in volume create CLI isn't accepting MB/KB formats --size parameter in volume create CLI isn't accepting MB format Dec 13, 2018
@rishubhjain
Copy link
Contributor

@atinmu Yes, I guess we missed out on MB, we have added for other formats https://github.com/gluster/glusterd2/blob/master/glustercli/cmd/utils.go#L32

@aravindavk
Copy link
Member

PR #1386 is merged which contains the fix

@Madhu-1
Copy link
Member

Madhu-1 commented Dec 17, 2018

reopening this issues, as we need to handle MB mib GB Gib formats in glustercli

[root@dhcp43-209 build]# ./glustercli volume create test115 --size=20MiB --replica=3 -v
Invalid Volume Size specified
[root@dhcp43-209 build]# ./glustercli volume create test115 --size=20MB --replica=3 -v
Invalid Volume Size specified

@Madhu-1 Madhu-1 reopened this Dec 17, 2018
Madhu-1 added a commit to Madhu-1/glusterd2 that referenced this issue Dec 17, 2018
we should be able to create volume size with
different formats like KB, Kib, Mb, MiB etc

Fixes: gluster#1398

```
[root@dhcp43-209 build]# ./glustercli volume create size1 --size=20MB --replica=3 -v
size1 Volume created successfully
Volume ID:  b2693574-8489-4d4b-94ab-3564776d1cce
[root@dhcp43-209 build]# ./glustercli volume create size2 --size=20MiB --replica=3 -v
size2 Volume created successfully
Volume ID:  b1153478-4912-4481-a047-8d67258ab08c
[root@dhcp43-209 build]# ./glustercli volume create size3 --size=20M --replica=3 -v
size3 Volume created successfully
Volume ID:  8ac1c9a5-cc84-45ec-b382-eff17369d024
```

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
@rishubhjain
Copy link
Contributor

@Madhu-1 check https://github.com/gluster/glusterd2/blob/master/glustercli/cmd/utils.go#L58, I am not sure why it is not accepting MiB and MB

@Madhu-1
Copy link
Member

Madhu-1 commented Dec 17, 2018

@rishubhjain PTAL #1416

Madhu-1 added a commit to Madhu-1/glusterd2 that referenced this issue Dec 17, 2018
we should be able to create volume size with
different formats like KB, Kib, Mb, MiB etc

Fixes: gluster#1398

```
[root@dhcp43-209 build]# ./glustercli volume create size1 --size=20MB --replica=3 -v
size1 Volume created successfully
Volume ID:  b2693574-8489-4d4b-94ab-3564776d1cce

[root@dhcp43-209 build]# ./glustercli volume create size2 --size=20MiB --replica=3 -v
size2 Volume created successfully
Volume ID:  b1153478-4912-4481-a047-8d67258ab08c

[root@dhcp43-209 build]# ./glustercli volume create size3 --size=20M --replica=3 -v
size3 Volume created successfully
Volume ID:  8ac1c9a5-cc84-45ec-b382-eff17369d024

[root@dhcp43-209 build]# ./glustercli volume create size35 --size=20 --replica=3 -v
size35 Volume created successfully
Volume ID:  560da74f-b7cf-466c-994c-0f03ba07bb24
```

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
Madhu-1 added a commit to Madhu-1/glusterd2 that referenced this issue Dec 17, 2018
we should be able to create volume size with
different formats like KB, Kib, Mb, MiB etc

Fixes: gluster#1398

```
[root@dhcp43-209 build]# ./glustercli volume create size1 --size=20MB --replica=3 -v
size1 Volume created successfully
Volume ID:  b2693574-8489-4d4b-94ab-3564776d1cce

[root@dhcp43-209 build]# ./glustercli volume create size2 --size=20MiB --replica=3 -v
size2 Volume created successfully
Volume ID:  b1153478-4912-4481-a047-8d67258ab08c

[root@dhcp43-209 build]# ./glustercli volume create size3 --size=20M --replica=3 -v
size3 Volume created successfully
Volume ID:  8ac1c9a5-cc84-45ec-b382-eff17369d024

[root@dhcp43-209 build]# ./glustercli volume create size35 --size=20 --replica=3 -v
size35 Volume created successfully
Volume ID:  560da74f-b7cf-466c-994c-0f03ba07bb24

[root@dhcp43-209 build]# ./glustercli volume create size --size=21mb --replica=3 -v
7size Volume created successfully
Volume ID:  638d4108-bf2e-48e9-9d1d-982a34882586

[root@dhcp43-209 build]# ./glustercli volume create sizes6 --size=20971520 --replica=3 -v
sizes6 Volume created successfully
Volume ID:  c4de7f7e-e4b4-46e6-80d1-92a9e060c4c0

[root@dhcp43-209 build]# ./glustercli volume create size6 --size=20971520sadf --replica=3 -v
Invalid Volume Size specified
```

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
atinmu pushed a commit that referenced this issue Dec 17, 2018
we should be able to create volume size with
different formats like KB, Kib, Mb, MiB etc

Fixes: #1398

```
[root@dhcp43-209 build]# ./glustercli volume create size1 --size=20MB --replica=3 -v
size1 Volume created successfully
Volume ID:  b2693574-8489-4d4b-94ab-3564776d1cce

[root@dhcp43-209 build]# ./glustercli volume create size2 --size=20MiB --replica=3 -v
size2 Volume created successfully
Volume ID:  b1153478-4912-4481-a047-8d67258ab08c

[root@dhcp43-209 build]# ./glustercli volume create size3 --size=20M --replica=3 -v
size3 Volume created successfully
Volume ID:  8ac1c9a5-cc84-45ec-b382-eff17369d024

[root@dhcp43-209 build]# ./glustercli volume create size35 --size=20 --replica=3 -v
size35 Volume created successfully
Volume ID:  560da74f-b7cf-466c-994c-0f03ba07bb24

[root@dhcp43-209 build]# ./glustercli volume create size --size=21mb --replica=3 -v
7size Volume created successfully
Volume ID:  638d4108-bf2e-48e9-9d1d-982a34882586

[root@dhcp43-209 build]# ./glustercli volume create sizes6 --size=20971520 --replica=3 -v
sizes6 Volume created successfully
Volume ID:  c4de7f7e-e4b4-46e6-80d1-92a9e060c4c0

[root@dhcp43-209 build]# ./glustercli volume create size6 --size=20971520sadf --replica=3 -v
Invalid Volume Size specified
```

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
GCS/0.5 GCS 0.5 release
Projects
None yet
Development

No branches or pull requests

4 participants