Project

General

Profile

resie.py

Resize Script - Tanay Ganguly, 05/31/2016 05:18 AM

Download (486 Bytes)

 
1
#!/bin/python
2
import os
3
import random
4
import time
5
size=11000
6
i=0
7
new_size=0
8
sh_size=0
9
while i < 100:
10
        x=random.randint(1,500)
11
        new_size=size + x 
12
        cmd1 = 'rbd resize cephfs_data/NEW_CLone --size %s' %new_size
13
        print 'cmd is %s' %cmd1
14
        os.system(cmd1)
15
        time.sleep(5)
16
        x=random.randint(1,100)
17
        sh_size= new_size - x
18
        cmd2 = 'rbd resize cephfs_data/NEW_CLone --size %s --allow-shrink' %sh_size
19
        print 'cmd2 is %s' %cmd2
20
        os.system(cmd2)
21
        i = i +1