Openstack-实践4.Manila 部署及功能验证

1.manila 部署 

基本环境: kolla-ansible  rocky+centos7.4 

vim /etc/kolla/globals.yml
enable_horizon_manila: "{{ enable_manila | bool }}"
enable_manila: "yes"
enable_manila_backend_generic: "yes"

vim /etc/kolla/config/manila-share.conf 
[generic]
service_instance_flavor_id = 2
kolla-ansible deploy -t mnila -i multinode 

2. 功能验证

2.1基本功能验证

特殊需求: 
1.可以修改share instance的实例密码; 
2.可以实现root用户远程登录;

root@deploy ~]# manila service-list 
+----+------------------+------------------+------+---------+-------+----------------------------+
| Id | Binary           | Host             | Zone | Status  | State | Updated_at                 |
+----+------------------+------------------+------+---------+-------+----------------------------+
| 1  | manila-share     | network1@generic | nova | enabled | up    | 2019-07-11T22:13:14.000000 |
| 2  | manila-data      | controller1      | nova | enabled | up    | 2019-07-11T22:13:10.000000 |
| 3  | manila-scheduler | controller1      | nova | enabled | up    | 2019-07-11T22:13:05.000000 |
+----+------------------+------------------+------+---------+-------+----------------------------+
manila type-create default_share_type True
wget https://tarballs.openstack.org/manila-image-elements/images/manila-service-image-master.qcow2
备注:此处名字必须为 manila-service-image
针对镜像操作:
virt-sysprep --operations \
"-abrt-data,-backup-files,-bash-history,-blkid-tab,\
-crash-data,-cron-spool,-dhcp-client-state,-dhcp-server-state,\
-dovecot-data,-logfiles,-machine-id,-mail-spool,-net-hostname,-net-hwaddr,-pacct-log,\
-package-manager-cache,-pam-data,-passwd-backups,-puppet-data-log,\
-rh-subscription-manager,-rhn-systemid,-rpm-db,-samba-db-log,-script,-smolt-uuid,\
-ssh-hostkeys,-ssh-userdir,-sssd-db-log,-tmp-files,-udev-persistent-net,\
-utmp,-yum-uuid,customize" \
--root-password disabled \
--mount-options "/:defaults,noatime,nodiratime" \
--network \
--install "qemu-guest-agent,cloud-init" \
--run-command  'systemctl enable qemu-guest-agent' \
-a manila-service-image-master.qcow2
qemu-img convert -f qcow2 -O raw manila-service-image-master.qcow2 manila-service-image-master.raw
virt-edit -a manila-service-image-master.raw /etc/ssh/sshd_config 
PermitRootLogin yes 
openstack network list 
manila share-network-create --name demo-share-network1 \
  --neutron-net-id demo-net \
  --neutron-subnet-id demo-subnet 
manila create --name share2 --share-network c7e32fae-0af3-4809-a0a5-f97635f0d0e8 --share-type default_share_type  nfs 10
 +--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
| ID                                   | Name   | Size | Share Proto | Status    | Is Public | Share Type Name    | Host                     | Availability Zone |
+--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
| 7e05d0d7-ce0d-4103-81a3-35e91944bd00 | share2 | 10   | NFS         | available | False     | default_share_type | network1@generic#GENERIC | nova              |
| a0cea893-0c53-4eae-93fa-257bdd3e303c | share1 | 100  | NFS         | available | False     | default_share_type | network1@generic#GENERIC | nova              |
+--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
[root@deploy ~]# manila show share1
+---------------------------------------+----------------------------------------------------------------------+
| Property                              | Value                                                                |
+---------------------------------------+----------------------------------------------------------------------+
| status                                | available                                                            |
| share_type_name                       | default_share_type                                                   |
| description                           | None                                                                 |
| availability_zone                     | nova                                                                 |
| share_network_id                      | c7e32fae-0af3-4809-a0a5-f97635f0d0e8                                 |
| export_locations                      |                                                                      |
|                                       | path = 10.254.0.5:/shares/share-4c9090d2-4d19-438c-a94c-445f9e0b8170 |
|                                       | preferred = False                                                    |
|                                       | is_admin_only = False                                                |
|                                       | id = 97cb067d-f2b2-4902-8606-af03730ceee3                            |
|                                       | share_instance_id = 4c9090d2-4d19-438c-a94c-445f9e0b8170             |
|                                       | path = 10.254.0.5:/shares/share-4c9090d2-4d19-438c-a94c-445f9e0b8170 |
|                                       | preferred = False                                                    |
|                                       | is_admin_only = True                                                 |
|                                       | id = 32c03ca0-a98a-4f26-9f28-ea3f1a963d27                            |
|                                       | share_instance_id = 4c9090d2-4d19-438c-a94c-445f9e0b8170             |
| share_server_id                       | 1b1e4744-fbdf-4554-b8c5-f281af0545b9                                 |
| share_group_id                        | None                                                                 |
| host                                  | network1@generic#GENERIC                                             |
| revert_to_snapshot_support            | False                                                                |
| access_rules_status                   | active                                                               |
| snapshot_id                           | None                                                                 |
| create_share_from_snapshot_support    | False                                                                |
| is_public                             | False                                                                |
| task_state                            | None                                                                 |
| snapshot_support                      | False                                                                |
| id                                    | a0cea893-0c53-4eae-93fa-257bdd3e303c                                 |
| size                                  | 100                                                                  |
| source_share_group_snapshot_member_id | None                                                                 |
| user_id                               | b33628be535a4cb083e30c880f874323                                     |
| name                                  | share1                                                               |
| share_type                            | 743bdf2f-7ca4-4394-947e-1a8aceb26622                                 |
| has_replicas                          | False                                                                |
| replication_type                      | None                                                                 |
| created_at                            | 2019-07-11T14:03:36.000000                                           |
| share_proto                           | NFS                                                                  |
| mount_snapshot_support                | False                                                                |
| project_id                            | c800b6587a864dd8a93cea7fe7c686a6                                     |
| metadata                              | {}                                                                   |
+---------------------------------------+----------------------------------------------------------------------+
[root@deploy ~]# openstack server list --all | grep manila 
| 34b275ed-0209-4b8c-80e3-86b0734d67bf | f267c7ba-965e-48d1-930c-54fb4302697e | ACTIVE  | manila_service_network=10.254.0.10 | manila-service-image | m1.small | 
openstack server set --root-passowrd 34b275ed-0209-4b8c-80e3-86b0734d67bf
[root@deploy ~]# openstack console url show 34b275ed-0209-4b8c-80e3-86b0734d67bf
+-------+-----------------------------------------------------------------------------------+
| Field | Value                                                                             |
+-------+-----------------------------------------------------------------------------------+
| type  | novnc                                                                             |
| url   | http://192.168.1.21:6080/vnc_auto.html?token=64245500-d565-4442-a3e9-5f29d88f0ecf |
ssh登录共享实例:
root@f267c7ba-965e-48d1-930c-54fb4302697e:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            976M     0  976M   0% /dev
tmpfs           200M  2.0M  198M   2% /run
/dev/vda1        19G  1.2G   17G   7% /
tmpfs           997M     0  997M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           997M     0  997M   0% /sys/fs/cgroup
tmpfs           200M     0  200M   0% /run/user/1000
/dev/vdb        9.8G   37M  9.3G   1% /shares/share-7fafec01-d356-4a90-bc80-c64ee0c9e4b6
tmpfs           200M     0  200M   0% /run/user/0
[root@deploy ~]# manila share-export-location-list share2
+--------------------------------------+----------------------------------------------------------------+-----------+
| ID                                   | Path                                                           | Preferred |
+--------------------------------------+----------------------------------------------------------------+-----------+
| 78b54bd1-8fb2-4408-a76c-ea16e83663b7 | 10.254.0.10:/shares/share-7fafec01-d356-4a90-bc80-c64ee0c9e4b6 | False     |
| b489c348-6cda-4ad4-94a8-97d24bea0c7b | 10.254.0.10:/shares/share-7fafec01-d356-4a90-bc80-c64ee0c9e4b6 | False     |
+--------------------------------------+----------------------------------------------------------------+-----------
# 创建访问规则
[root@deploy ~]# manila access-allow share2 ip 10.0.0.4
+--------------+--------------------------------------+
| Property     | Value                                |
+--------------+--------------------------------------+
| access_key   | None                                 |
| share_id     | adb41a06-7cd1-40c1-a216-a7162ac93b79 |
| created_at   | 2019-07-12T22:38:48.000000           |
| updated_at   | None                                 |
| access_type  | ip                                   |
| access_to    | 10.0.0.4                             |
| access_level | rw                                   |
| state        | queued_to_apply                      |
| id           | 61262a01-6fea-4747-8288-b9b5185b5bee |
| metadata     | {}                                   |
+--------------+--------------------------------------+
虚拟共享实例机内部:
  1 /shares/share-7fafec01-d356-4a90-bc80-c64ee0c9e4b6  10.0.0.4(rw,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_sub    tree_check,secure_locks,acl,no_pnfs,anonuid=65534,anongid=65534,sec=sys,rw,secure,no_root_squash,no_all_squash)
  [root@deploy ~]# manila access-list share2
+--------------------------------------+-------------+-----------+--------------+--------+------------+----------------------------+------------+
| id                                   | access_type | access_to | access_level | state  | access_key | created_at                 | updated_at |
+--------------------------------------+-------------+-----------+--------------+--------+------------+----------------------------+------------+
| 61262a01-6fea-4747-8288-b9b5185b5bee | ip          | 10.0.0.4  | rw           | active | None       | 2019-07-12T22:38:48.000000 | None       |
+--------------------------------------+-------------+-----------+--------------+--------+------------+----------------------------+------------+
[root@deploy ~]# manila access-allow share2  ip 20.0.0.0/24 --access-level ro
+--------------+--------------------------------------+
| Property     | Value                                |
+--------------+--------------------------------------+
| access_key   | None                                 |
| share_id     | adb41a06-7cd1-40c1-a216-a7162ac93b79 |
| created_at   | 2019-07-12T22:42:43.000000           |
| updated_at   | None                                 |
| access_type  | ip                                   |
| access_to    | 20.0.0.0/24                          |
| access_level | ro                                   |
| state        | queued_to_apply                      |
| id           | 7cf0bd41-deab-46a4-a104-547742883a77 |
| metadata     | {}                                   |
+--------------+--------------------------------------+
[root@deploy ~]# manila access-list share2
+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+
| id                                   | access_type | access_to   | access_level | state  | access_key | created_at                 | updated_at |
+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+
| 61262a01-6fea-4747-8288-b9b5185b5bee | ip          | 10.0.0.4    | rw           | active | None       | 2019-07-12T22:38:48.000000 | None       |
| 7cf0bd41-deab-46a4-a104-547742883a77 | ip          | 20.0.0.0/24 | ro           | active | None       | 2019-07-12T22:42:43.000000 | None       |
+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+
vim /etc/exports 
 /shares/share-7fafec01-d356-4a90-bc80-c64ee0c9e4b6  10.0.0.4(rw,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=65534,anongid=65534,sec=sys    ,rw,secure,no_root_squash,no_all_squash)
  2 /shares/share-7fafec01-d356-4a90-bc80-c64ee0c9e4b6  20.0.0.0/24(ro,sync,wdelay,hide,nocrossmnt,secure,no_root_squash,no_all_squash,no_subtree_check,secure_locks,acl,no_pnfs,anonuid=65534,anongid=65534,sec=    sys,ro,secure,no_root_squash,no_all_squash)
# 取消访问规则
[root@deploy ~]# manila access-deny  share2  61262a01-6fea-4747-8288-b9b5185b5bee
[root@deploy ~]# manila access-deny  share2  7cf0bd41-deab-46a4-a104-547742883a77 
[root@deploy ~]# manila access-list  share2 
+----+-------------+-----------+--------------+-------+------------+------------+------------+
| id | access_type | access_to | access_level | state | access_key | created_at | updated_at |
+----+-------------+-----------+--------------+-------+------------+------------+------------+
+----+-------------+-----------+--------------+-------+------------+------------+------------+

2.2 快照功能

快照操作:
请确认创建的 `share-type` 已启用快照支持,如未启用快照支持,可参照下面的命令重新创建 `share-type`
 usage: manila type-create [--description <description>]
>                           [--snapshot_support <snapshot_support>]
>                           [--create_share_from_snapshot_support <create_share_from_snapshot_support>]
>                           [--revert_to_snapshot_support <revert_to_snapshot_support>]
>                           [--mount_snapshot_support <mount_snapshot_support>]
>                           [--extra-specs [<key=value> [<key=value> ...]]]
>                           [--is_public <is_public>]
>                           <name> <spec_driver_handles_share_servers>
> 
> Create a new share type (Admin only).
> 
> Positional arguments:
>   <name>                Name of the new share type.
>   <spec_driver_handles_share_servers>
>                         Required extra specification. Valid values are
>                         'true'/'1' and 'false'/'0'.
> 
> Optional arguments:
>   --description <description>
>                         Filter results by description. Available only for
>                         microversion >= 2.41.
>   --snapshot_support <snapshot_support>, --snapshot-support <snapshot_support>
>                         Boolean extra spec used for filtering of back ends by
>                         their capability to create share snapshots.
>   --create_share_from_snapshot_support <create_share_from_snapshot_support>, --create-share-from-snapshot-support <create_share_from_snapshot_support>
>                         Boolean extra spec used for filtering of back ends by
>                         their capability to create shares from snapshots.
>   --revert_to_snapshot_support <revert_to_snapshot_support>, --revert-to-snapshot-support <revert_to_snapshot_support>
>                         Boolean extra spec used for filtering of back ends by
>                         their capability to revert shares to snapshots.
>                         (Default is False).
>   --mount_snapshot_support <mount_snapshot_support>, --mount-snapshot-support <mount_snapshot_support>
>                         Boolean extra spec used for filtering of back ends by
>                         their capability to mount share snapshots. (Default is
>                         False).
>   --extra-specs [<key=value> [<key=value> ...]], --extra_specs [<key=value> [<key=value> ...]]
>                         Extra specs key and value of share type that will be
>                         used for share type creation. OPTIONAL: Default=None.
>                         example --extra-specs thin_provisioning='<is> True',
>                         replication_type=readable.
>   --is_public <is_public>, --is-public <is_public>
>                         Make type accessible to the public (default true).
> 
manila type-create \
--snapshot_support True \
--create_share_from_snapshot_support True \
default_share_type True
或者
manila type-key default_share_type \
set snapshot_support=True \
create_share_from_snapshot_support=True 
备注:最好是在创建 default_type_share的时候指定是否支持快照。
[root@deploy ~]# manila show share1
+---------------------------------------+-----------------------------------------------------------------------+
| Property                              | Value                                                                 |
+---------------------------------------+-----------------------------------------------------------------------+
| status                                | available                                                             |
| share_type_name                       | default_share_type                                                    |
| description                           | None                                                                  |
| availability_zone                     | nova                                                                  |
| share_network_id                      | c7e32fae-0af3-4809-a0a5-f97635f0d0e8                                  |
| export_locations                      |                                                                       |
|                                       | path = 10.254.0.11:/shares/share-6121a068-9615-4452-a2cd-27e2af0b923d |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = False                                                 |
|                                       | id = fc26c793-c3cc-44d9-b543-25af199373fd                             |
|                                       | share_instance_id = 6121a068-9615-4452-a2cd-27e2af0b923d              |
|                                       | path = 10.254.0.11:/shares/share-6121a068-9615-4452-a2cd-27e2af0b923d |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = True                                                  |
|                                       | id = 4902805b-dac7-4bd8-bdde-8dae077de3da                             |
|                                       | share_instance_id = 6121a068-9615-4452-a2cd-27e2af0b923d              |
| share_server_id                       | f4455a66-b45b-4132-92b9-28ea5f5e6429                                  |
| share_group_id                        | None                                                                  |
| host                                  | network1@generic#GENERIC                                              |
| revert_to_snapshot_support            | False                                                                 |
| access_rules_status                   | active                                                                |
| snapshot_id                           | None                                                                  |
| create_share_from_snapshot_support    | True                                                                  |
| is_public                             | False                                                                 |
| task_state                            | None                                                                  |
| snapshot_support                      | True                                                                  |
| id                                    | a24b3222-9b1e-436d-a5e2-cc285d3e9b05                                  |
| size                                  | 1                                                                     |
| source_share_group_snapshot_member_id | None                                                                  |
| user_id                               | b33628be535a4cb083e30c880f874323                                      |
| name                                  | share1                                                                |
| share_type                            | 8d0b99f7-d481-496b-a4d7-ebffa3e3fa20                                  |
| has_replicas                          | False                                                                 |
| replication_type                      | None                                                                  |
| created_at                            | 2019-07-13T00:13:24.000000                                            |
| share_proto                           | NFS                                                                   |
| mount_snapshot_support                | False                                                                 |
| project_id                            | c800b6587a864dd8a93cea7fe7c686a6                                      |
| metadata                              | {}                                                                    |
+---------------------------------------+-----------------------------------------------------------------------+
[root@deploy ~]# manila snapshot-create --name mysnapshot --description "My Manila snapshot" share1
+-------------------+--------------------------------------+
| Property          | Value                                |
+-------------------+--------------------------------------+
| status            | creating                             |
| share_id          | a24b3222-9b1e-436d-a5e2-cc285d3e9b05 |
| user_id           | b33628be535a4cb083e30c880f874323     |
| description       | My Manila snapshot                   |
| created_at        | 2019-07-13T00:24:22.848368           |
| size              | 1                                    |
| share_proto       | NFS                                  |
| provider_location | None                                 |
| id                | c85c42c3-8e64-41da-b3c2-e547e7dd3b75 |
| project_id        | c800b6587a864dd8a93cea7fe7c686a6     |
| share_size        | 1                                    |
| name              | mysnapshot                           |
+-------------------+--------------------------------------+
[root@deploy ~]# manila snapshot-list
+--------------------------------------+--------------------------------------+-----------+------------+------------+
| ID                                   | Share ID                             | Status    | Name       | Share Size |
+--------------------------------------+--------------------------------------+-----------+------------+------------+
| c85c42c3-8e64-41da-b3c2-e547e7dd3b75 | a24b3222-9b1e-436d-a5e2-cc285d3e9b05 | available | mysnapshot | 1          |
+--------------------------------------+--------------------------------------+-----------+------------+------------+
manila create NFS 1 \
    --snapshot-id  c85c42c3-8e64-41da-b3c2-e547e7dd3b75 \
    --share-network demo-share-network1 \
    --share-type default_share_type \
    --name mysharefromsnap
[root@deploy ~]# manila show mysharefromsnap
+---------------------------------------+-----------------------------------------------------------------------+
| Property                              | Value                                                                 |
+---------------------------------------+-----------------------------------------------------------------------+
| status                                | available                                                             |
| share_type_name                       | default_share_type                                                    |
| description                           | None                                                                  |
| availability_zone                     | nova                                                                  |
| share_network_id                      | c7e32fae-0af3-4809-a0a5-f97635f0d0e8                                  |
| export_locations                      |                                                                       |
|                                       | path = 10.254.0.11:/shares/share-22f5df94-a054-4324-9592-a1d63ac82d25 |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = False                                                 |
|                                       | id = b96597e8-7c5c-474d-a50f-1c6e5e99bd14                             |
|                                       | share_instance_id = 22f5df94-a054-4324-9592-a1d63ac82d25              |
|                                       | path = 10.254.0.11:/shares/share-22f5df94-a054-4324-9592-a1d63ac82d25 |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = True                                                  |
|                                       | id = 8008c6df-9050-4ccd-a092-54dbebce59ed                             |
|                                       | share_instance_id = 22f5df94-a054-4324-9592-a1d63ac82d25              |
| share_server_id                       | f4455a66-b45b-4132-92b9-28ea5f5e6429                                  |
| share_group_id                        | None                                                                  |
| host                                  | network1@generic#GENERIC                                              |
| revert_to_snapshot_support            | False                                                                 |
| access_rules_status                   | active                                                                |
| snapshot_id                           | c85c42c3-8e64-41da-b3c2-e547e7dd3b75                                  |
| create_share_from_snapshot_support    | True                                                                  |
| is_public                             | False                                                                 |
| task_state                            | None                                                                  |
| snapshot_support                      | True                                                                  |
| id                                    | 6729d3c0-2b59-46af-b15d-44a2b5d7df44                                  |
| size                                  | 1                                                                     |
| source_share_group_snapshot_member_id | None                                                                  |
| user_id                               | b33628be535a4cb083e30c880f874323                                      |
| name                                  | mysharefromsnap                                                       |
| share_type                            | 8d0b99f7-d481-496b-a4d7-ebffa3e3fa20                                  |
| has_replicas                          | False                                                                 |
| replication_type                      | None                                                                  |
| created_at                            | 2019-07-13T00:30:19.000000                                            |
| share_proto                           | NFS                                                                   |
| mount_snapshot_support                | False                                                                 |
| project_id                            | c800b6587a864dd8a93cea7fe7c686a6                                      |
| metadata                              | {}                                                                    |
+---------------------------------------+-----------------------------------------------------------------------+
[root@deploy ~]# manila list 
+--------------------------------------+-----------------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
| ID                                   | Name            | Size | Share Proto | Status    | Is Public | Share Type Name    | Host                     | Availability Zone |
+--------------------------------------+-----------------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
| 6729d3c0-2b59-46af-b15d-44a2b5d7df44 | mysharefromsnap | 1    | NFS         | available | False     | default_share_type | network1@generic#GENERIC | nova              |
| a24b3222-9b1e-436d-a5e2-cc285d3e9b05 | share1          | 1    | NFS         | available | False     | default_share_type | network1@generic#GENERIC | nova              |
+--------------------------------------+-----------------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
manila delete mysharefromsnap
manila snapshot-delete mysnapshot

2.3 共享扩容和缩减

[root@deploy ~]# manila extend share1 2 
[root@deploy ~]# manila show share1
+---------------------------------------+-----------------------------------------------------------------------+
| Property                              | Value                                                                 |
+---------------------------------------+-----------------------------------------------------------------------+
| status                                | extending                                                             |
| share_type_name                       | default_share_type                                                    |
| description                           | None                                                                  |
| availability_zone                     | nova                                                                  |
| share_network_id                      | c7e32fae-0af3-4809-a0a5-f97635f0d0e8                                  |
| export_locations                      |                                                                       |
|                                       | path = 10.254.0.11:/shares/share-6121a068-9615-4452-a2cd-27e2af0b923d |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = False                                                 |
|                                       | id = fc26c793-c3cc-44d9-b543-25af199373fd                             |
|                                       | share_instance_id = 6121a068-9615-4452-a2cd-27e2af0b923d              |
|                                       | path = 10.254.0.11:/shares/share-6121a068-9615-4452-a2cd-27e2af0b923d |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = True                                                  |
|                                       | id = 4902805b-dac7-4bd8-bdde-8dae077de3da                             |
|                                       | share_instance_id = 6121a068-9615-4452-a2cd-27e2af0b923d              |
| share_server_id                       | f4455a66-b45b-4132-92b9-28ea5f5e6429                                  |
| share_group_id                        | None                                                                  |
| host                                  | network1@generic#GENERIC                                              |
| revert_to_snapshot_support            | False                                                                 |
| access_rules_status                   | active                                                                |
| snapshot_id                           | None                                                                  |
| create_share_from_snapshot_support    | True                                                                  |
| is_public                             | False                                                                 |
| task_state                            | None                                                                  |
| snapshot_support                      | True                                                                  |
| id                                    | a24b3222-9b1e-436d-a5e2-cc285d3e9b05                                  |
| size                                  | 1                                                                     |
| source_share_group_snapshot_member_id | None                                                                  |
| user_id                               | b33628be535a4cb083e30c880f874323                                      |
| name                                  | share1                                                                |
| share_type                            | 8d0b99f7-d481-496b-a4d7-ebffa3e3fa20                                  |
| has_replicas                          | False                                                                 |
| replication_type                      | None                                                                  |
| created_at                            | 2019-07-13T00:13:24.000000                                            |
| share_proto                           | NFS                                                                   |
| mount_snapshot_support                | False                                                                 |
| project_id                            | c800b6587a864dd8a93cea7fe7c686a6                                      |
| metadata                              | {}                                                                    |
+---------------------------------------+-----------------------------------------------------------------------+
root@ubuntu:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            976M     0  976M   0% /dev
tmpfs           200M  2.0M  198M   1% /run
/dev/vda1        19G  1.2G   17G   7% /
tmpfs           997M     0  997M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           997M     0  997M   0% /sys/fs/cgroup
tmpfs           200M     0  200M   0% /run/user/1000
/dev/vdb        2.0G  3.0M  1.9G   1% /shares/share-6121a068-9615-4452-a2cd-27e2af0b923d
tmpfs           200M     0  200M   0% /run/user/0
缩容:
[root@deploy ~]# manila shrink  share1 1
[root@deploy ~]# manila show share1
+---------------------------------------+-----------------------------------------------------------------------+
| Property                              | Value                                                                 |
+---------------------------------------+-----------------------------------------------------------------------+
| status                                | shrinking                                                             |
| share_type_name                       | default_share_type                                                    |
| description                           | None                                                                  |
| availability_zone                     | nova                                                                  |
| share_network_id                      | c7e32fae-0af3-4809-a0a5-f97635f0d0e8                                  |
| export_locations                      |                                                                       |
|                                       | path = 10.254.0.11:/shares/share-6121a068-9615-4452-a2cd-27e2af0b923d |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = False                                                 |
|                                       | id = fc26c793-c3cc-44d9-b543-25af199373fd                             |
|                                       | share_instance_id = 6121a068-9615-4452-a2cd-27e2af0b923d              |
|                                       | path = 10.254.0.11:/shares/share-6121a068-9615-4452-a2cd-27e2af0b923d |
|                                       | preferred = False                                                     |
|                                       | is_admin_only = True                                                  |
|                                       | id = 4902805b-dac7-4bd8-bdde-8dae077de3da                             |
|                                       | share_instance_id = 6121a068-9615-4452-a2cd-27e2af0b923d              |
| share_server_id                       | f4455a66-b45b-4132-92b9-28ea5f5e6429                                  |
| share_group_id                        | None                                                                  |
| host                                  | network1@generic#GENERIC                                              |
| revert_to_snapshot_support            | False                                                                 |
| access_rules_status                   | active                                                                |
| snapshot_id                           | None                                                                  |
| create_share_from_snapshot_support    | True                                                                  |
| is_public                             | False                                                                 |
| task_state                            | None                                                                  |
| snapshot_support                      | True                                                                  |
| id                                    | a24b3222-9b1e-436d-a5e2-cc285d3e9b05                                  |
| size                                  | 2                                                                     |
| source_share_group_snapshot_member_id | None                                                                  |
| user_id                               | b33628be535a4cb083e30c880f874323                                      |
| name                                  | share1                                                                |
| share_type                            | 8d0b99f7-d481-496b-a4d7-ebffa3e3fa20                                  |
| has_replicas                          | False                                                                 |
| replication_type                      | None                                                                  |
| created_at                            | 2019-07-13T00:13:24.000000                                            |
| share_proto                           | NFS                                                                   |
| mount_snapshot_support                | False                                                                 |
| project_id                            | c800b6587a864dd8a93cea7fe7c686a6                                      |
| metadata                              | {}                                                                    |
+---------------------------------------+-----------------------------------------------------------------------+
[root@deploy ~]# manila list 
+--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
| ID                                   | Name   | Size | Share Proto | Status    | Is Public | Share Type Name    | Host                     | Availability Zone |
+--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
| a24b3222-9b1e-436d-a5e2-cc285d3e9b05 | share1 | 1    | NFS         | available | False     | default_share_type | network1@generic#GENERIC | nova              |
+--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+--------------------------+-------------------+
root@ubuntu:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            976M     0  976M   0% /dev
tmpfs           200M  2.0M  198M   1% /run
/dev/vda1        19G  1.2G   17G   7% /
tmpfs           997M     0  997M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           997M     0  997M   0% /sys/fs/cgroup
tmpfs           200M     0  200M   0% /run/user/1000
tmpfs           200M     0  200M   0% /run/user/0
/dev/vdb        976M  2.6M  907M   1% /shares/share-6121a068-9615-4452-a2cd-27e2af0b923d

 

也可以关注微信公众号:启航学城,干货满满,扫码关注:

 也欢迎加入OpenStack技术交流群,进行技术交流。

posted @ 2019-07-16 13:12  启航学城  阅读(637)  评论(0编辑  收藏  举报