Ask Your Question

[ironic] How to resize to use whole disk size after deploying

asked 2017-03-21 05:14:10 -0600

Joe gravatar image

updated 2017-03-21 11:20:57 -0600

I set up standalone ironic with mitaka version. I created a whole disk image (ubuntu 14.04) without LVM by following this OpenStack Doc: Create images manually. Init-cloud and cloud-initramfs-growroot were installed to resize root partition.

The disk image size is 10G, and it could be deployed successfully on my node. When I logged in the node and checked the disk info, it only used 10G disk size for /dev/sda. (But the physical disk size of node is 500G)

The disk info: image description

How do I make my image to use whole disk size of node after deploying? Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-04-07 06:15:10 -0600

Joe gravatar image

I'm not sure the following approach is suitable, but it works well.

  1. Still follow the guide to create an qcow2 image with LVM.
  2. Add firstboot script to the image when virt-sysprep.

In the script,

1) Use parted to resize extended partition to the end of whole disk.

2) Make a new logical partition for undefined disk size as /dev/sda6.

3) Set /dev/sda6 as lvm label.

4) Create a new physical volume for /dev/sda6.

5) Add this physical volume to the original volume group.

6) Extend root logical volume (/dev/mapper/ubuntu--vg-root) with /dev/sda6.

7) resize2fs /dev/mapper/ubuntu--vg-root.

Please give me any suggestions if something wrong. Thanks.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-03-21 05:14:10 -0600

Seen: 1,038 times

Last updated: Apr 07 '17