]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
ceph-volume-zfs: add the inventory command
authorWillem Jan Withagen <wjw@digiware.nl>
Fri, 18 Oct 2019 14:21:09 +0000 (16:21 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Fri, 18 Oct 2019 14:21:09 +0000 (16:21 +0200)
commitefe4eb61c14ef4d3dab05084023343027bdb7e0a
tree39837b21083b010bbd75e5acc48bb8cb241d7b70
parent4154eae83a3686877e1c38ad033f5f56ea39981d
ceph-volume-zfs: add the inventory command

```
usage: ceph-volume zfs inventory [-h] [--format {plain,json,json-pretty}]
                                 [path]

Generate an inventory of available devices

positional arguments:
  path                  Report on specific disk

optional arguments:
  -h, --help            show this help message and exit
  --format {plain,json,json-pretty}
                        Output format
```

Which genrates:
```
wjw@zfstest.digiware.nl> ceph-volume zfs inventory

/dev/Device Path      Size             rotates Model name
/dev/ada0             232.89 GB        True    ST3250318AS
/dev/ada1             232.89 GB        True    ST3250318AS
/dev/ada2             223.57 GB        False   INTEL SSDSC2BB240G6
/dev/ada3             37.27 GB         False   Corsair CSSD-F40GB2

```

or:
```
wjw@zfstest.digiware.nl> ceph-volume zfs inventory --format json-pretty ada3
[
    {
        "abspath": "/dev/ada3",
        "available": true,
        "path": "/dev/ada3",
        "reject_reasons": [],
        "sys_api": {
            "descr": "Corsair CSSD-F40GB2",
            "fwheads": "16",
            "fwsectors": "63",
            "geomname": "ada3",
            "ident": "111465010000101800EC",
            "lunid": "5000000000000236",
            "mediasize": "40018599936 ",
            "mode": "r2w2e6",
            "name": "ada3",
            "rotationrate": "0",
            "sectorsize": "512",
            "stripeoffset": "0",
            "stripesize": "4096"
        }
    }
]
```

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/ceph-volume/plugin/zfs/ceph_volume_zfs/__init__.py
src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/__init__.py
src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/inventory.py [new file with mode: 0644]
src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/main.py [changed mode: 0755->0644]
src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/prepare.py [new file with mode: 0644]
src/ceph-volume/plugin/zfs/ceph_volume_zfs/devices/zfs/zap.py [new file with mode: 0644]
src/ceph-volume/plugin/zfs/ceph_volume_zfs/main.py [deleted file]
src/ceph-volume/plugin/zfs/ceph_volume_zfs/util/disk.py [new file with mode: 0644]
src/ceph-volume/plugin/zfs/ceph_volume_zfs/zfs.py [new file with mode: 0755]
src/ceph-volume/plugin/zfs/setup.py