Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1455961 Details for
Bug 1312387
[RFE] pvresize option not available with ssm (system-storage-manager)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
with pvresize option and corrected indentation error.
ssm_pvresize.patch (text/plain), 7.23 KB, created by
Nitin Yewale
on 2018-07-02 13:28:52 UTC
(
hide
)
Description:
with pvresize option and corrected indentation error.
Filename:
MIME Type:
Creator:
Nitin Yewale
Created:
2018-07-02 13:28:52 UTC
Size:
7.23 KB
patch
obsolete
>diff -Naur a/ssmlib/main.py b/ssmlib/main.py >--- a/ssmlib/main.py 2018-07-02 16:28:30.293577256 +0530 >+++ b/ssmlib/main.py 2018-07-02 18:57:00.363587857 +0530 >@@ -441,6 +441,13 @@ > "to achieve by removing " + > "{0}".format(device)) > >+ def resize(self, device): >+ self.device = device >+ print("Device to resize is {}".format(self.device)) >+ command = ['pvresize'] >+ command.append(self.device) >+ return misc.run(command, stdout=True, can_fail=True)[0] >+ > def set_globals(self, options): > self.options = options > >@@ -1118,66 +1125,74 @@ > number of devices are added into the pool to be able to cover the > resize. > """ >- args.pool = self.pool[args.volume['pool_name']] >- vol_size = float(args.volume['vol_size']) > >- if args.pool != None and args.pool.type == 'btrfs': >- msg = "Resizing btrfs volume is not supported" >- raise problem.NotSupported(msg) >+ device_type = args.volume.__dict__['type'] >+ if device_type == 'device': >+ args.dev = args.volume['name'] >+ #args.dev = args.volume['dev_name'] >+ args.volume.resize() > >- # Backend might not support pooling >- if args.pool is None: >- pool_free = 0.0 >- pool_name = "none" > else: >- pool_free = float(args.pool['pool_free']) >- pool_name = args.pool.name >+ args.pool = self.pool[args.volume['pool_name']] >+ vol_size = float(args.volume['vol_size']) > >- # Calculate the size from the size argument >- new_size = calculate_resize_size(args.size, args.volume, args.pool) >+ if args.pool != None and args.pool.type == 'btrfs': >+ msg = "Resizing btrfs volume is not supported" >+ raise problem.NotSupported(msg) >+ >+ # Backend might not support pooling >+ if args.pool is None: >+ pool_free = 0.0 >+ pool_name = "none" >+ else: >+ pool_free = float(args.pool['pool_free']) >+ pool_name = args.pool.name > >- size_change = new_size - vol_size >+ # Calculate the size from the size argument >+ new_size = calculate_resize_size(args.size, args.volume, args.pool) > >- fs = True if 'fs_info' in args.volume else False >+ size_change = new_size - vol_size > >- if new_size <= 0: >- PR.error("New volume size \'{0} KB\' is too small".format(new_size)) >+ fs = True if 'fs_info' in args.volume else False > >- if vol_size == new_size: >- # Try to grow the file system, since there is nothing to >- # do with the volume itself. >- if fs: >- ret = args.volume['fs_info'].resize() >- if ret: >- PR.error("File system on {0} can not be resized".format(args.volume.name)) >- else: >- PR.check(PR.RESIZE_ALREADY_MATCH, [args.volume.name, new_size]) >- return >+ if new_size <= 0: >+ PR.error("New volume size \'{0} KB\' is too small".format(new_size)) > >- # No need to do anything with provided devices since >- # we do have enough space to cover the resize >- if (pool_free < size_change): >- have_size, devices = self._filter_device_list(args, >- pool_free, >- new_size) >- else: >- have_size = pool_free >+ if vol_size == new_size: >+ # Try to grow the file system, since there is nothing to >+ # do with the volume itself. >+ if fs: >+ ret = args.volume['fs_info'].resize() >+ if ret: >+ PR.error("File system on {0} can not be resized".format(args.volume.name)) >+ else: >+ PR.check(PR.RESIZE_ALREADY_MATCH, [args.volume.name, new_size]) >+ return > >- if args.volume['type'] == 'thin': >- # No reason to check anything here size is not an concern >- pass >- elif have_size < size_change: >- PR.check(PR.RESIZE_NOT_ENOUGH_SPACE, >- [pool_name, args.volume.name, new_size]) >- elif len(args.device) > 0 and size_change > pool_free: >- try: >- self.add(args, True) >- except problem.NotSupported: >- # Some backends might not support pooling at all. >+ # No need to do anything with provided devices since >+ # we do have enough space to cover the resize >+ if (pool_free < size_change): >+ have_size, devices = self._filter_device_list(args, >+ pool_free, >+ new_size) >+ else: >+ have_size = pool_free >+ >+ if args.volume['type'] == 'thin': >+ # No reason to check anything here size is not an concern > pass >+ elif have_size < size_change: >+ PR.check(PR.RESIZE_NOT_ENOUGH_SPACE, >+ [pool_name, args.volume.name, new_size]) >+ elif len(args.device) > 0 and size_change > pool_free: >+ try: >+ self.add(args, True) >+ except problem.NotSupported: >+ # Some backends might not support pooling at all. >+ pass > >- if new_size != vol_size: >- args.volume.resize(new_size, fs) >+ if new_size != vol_size: >+ args.volume.resize(new_size, fs) > > def create(self, args): > """ >@@ -1556,6 +1571,11 @@ > vol = self.vol[string] > if vol: > return vol >+ >+ device = self.dev[string] >+ if device: >+ return device >+ > err = "'{0}' is not a valid volume to resize".format(string) > raise argparse.ArgumentTypeError(err) > >@@ -1866,13 +1886,16 @@ > Resize command > """ > parser_resize = self.subcommands.add_parser("resize", >- help="Change or set the volume and file system size.") >+ help='''Change or set the size of the object. Object could be >+ device, volume or file system size. For example, `ssm resize device`, >+ `ssm resize -s new_size volume_name`''') > parser_resize.add_argument("volume", help="Volume to resize.", > type=self.storage.can_resize) > parser_resize.add_argument('-s', '--size', > help='''New size of the volume. With the + or - sign the > value is added to or subtracted from the actual size of >- the volume and without it, the value will be set as the >+ the volume For example `ssm resize +2G volume_name` will add >+ 2GB to existing size and without it, the value will be set as the > new volume size. A size suffix of [k|K] for kilobytes, > [m|M] for megabytes, [g|G] for gigabytes, [t|T] for > terabytes or [p|P] for petabytes is optional. If no unit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1312387
: 1455961 |
1634855
|
1634856
|
1634857