0%

OpenStack Volume

Openstack volume

create some specified volume-types volume with qos

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 1. create volume type
openstack volume type create frontend_qos_1
openstack volume type create frontend_qos_2

# 2. create a QoS-1
openstack volume qos create qos1 --consumer front-end \
--property read_iops_sec=2000 \
--property write_iops_sec=2048

# 3. associate QoS-1 and volume type
openstack volume qos associate qos1 frontend_qos_1
openstack volume qos associate qos1 frontend_qos_2

# 4. create volumes
openstack volume create --type frontend_qos_1 --size 1 volume01
openstack volume create --type frontend_qos_1 --size 1 volume02
openstack volume create --type frontend_qos_2 --size 2 volume03
openstack volume create --type frontend_qos_2 --size 2 volume04

# 5. create a network
openstack network create cc_net_1
neutron subnet-create --name cc_net_1_sub cc_net_1 192.168.1.0/24

# 6. create a vm
openstack server create vm4qos1 --flavor 3 --image TestVM --nic net-id=86e0c8c9-6c66-46ce-aee5-03dccd4d9156
openstack server create vm4qos2 --flavor 3 --image TestVM --nic net-id=86e0c8c9-6c66-46ce-aee5-03dccd4d9156
openstack server create vm4qos3 --flavor 3 --image TestVM --nic net-id=86e0c8c9-6c66-46ce-aee5-03dccd4d9156
openstack server create vm4qos4 --flavor 3 --image TestVM --nic net-id=86e0c8c9-6c66-46ce-aee5-03dccd4d9156

# 7. attach a volume for a vm
# openstack server add volume INSTANCE_ID VOLUME_ID
openstack server add volume vm4qos1 volume01
openstack server add volume vm4qos2 volume02
openstack server add volume vm4qos3 volume03
openstack server add volume vm4qos4 volume04

# 8. update QoS
openstack volume qos set --property "read_iops_sec=10000" --property "write_iops_sec=8000" qos1
openstack volume qos set --property "read_bytes_sec=2000" --property "write_bytes_sec=2048" qos1
openstack volume qos unset --property "read_iops_sec" --property "write_iops_sec" qos1
openstack volume qos disassociate qos1 --volume-type frontend_qos_2
openstack volume qos disassociate qos1 --all

# ******** reset env(except for network) ********
openstack server delete vm4qos1
openstack server delete vm4qos2
openstack server delete vm4qos3
openstack server delete vm4qos4

openstack volume delete volume01
openstack volume delete volume02
openstack volume delete volume03
openstack volume delete volume04

openstack volume qos delete qos1
openstack volume type delete frontend_qos_1
openstack volume type delete frontend_qos_2