Re: How to Best Shrink Volume

2023-09-04 Thread Wido den Hollander




Op 04-09-2023 om 17:13 schreef Granwille Strauss:

Hi

Thank you, in our case, we start our VMs at 60 GB, clients then can 
upgrade to 120 GB as the next upgrade. However, clients also have the 
option to "Downgrade" back to 60 GB based on their package. Would kinda 
not make sense to prohibit clients from doing that, from a legal POV. So 
this kinda creates an issue now and its good I tested it out now. I 
tried the 'qemu-img resize --shrink /var/lib/libvirt/images/`  
and it seems it corrupted the image file. Not sure if it had to be 
converted first maybe.




Many providers simply don't allow for an upgrade because it's 
technically not feasible with QCOW2.


What you did is not shrink the volume, you only shrank the filesystem 
and partition.


I noticed that the images are not saved as .QCOW2 files, can you perhaps 
confirm what format they're currently in? I would like to run some more 
test and maybe see how well it goes and potentially propose a solution.




If you for example woud use Ceph with RBD you would be able to shrink 
the volume.


Wido


On 9/4/23 17:06, Wei ZHOU wrote:

Hi,

Normally cloud providers create vm templates with small size (e.g. 10GB).
When create vm from the template, user can override the root disk size so
that vm have a larger size (e.g. 60GB)
If the vm template has cloud-init installed, it can detect the new disk
size and auto-grow the partition to use the full disk.

In your case, if users pay for only 60GB, resizing to 120GB should be
forbidden.

-Wei

On Mon, 4 Sept 2023 at 16:51, Granwille Strauss
  wrote:


Hi Wido

Thank you. Yes, I only shrink it inside the VM. But still Cloudstack
volume shows 120GB and within the VM lsblk command shows that 120 GB is
available. Since I cannot shrink the volume, how do most providers take
care of this issue? I mean it would be awkward if a client see they can
have 120 GB available when they're paying for 60 GB, for example.[image:
Powered by AdSigner]



--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by 
mistake, please inform us by email reply and then delete the message. It 
is forbidden to copy, forward, or in any way reveal the contents of this 
message to anyone without our explicit consent. The integrity and 
security of this email cannot be guaranteed over the Internet. 
Therefore, the sender will not be held liable for any damage caused by 
the message. For our full privacy policy and disclaimers, please go to 
https://www.namhost.com/privacy-policy


Powered by AdSigner 



Re: How to Best Shrink Volume

2023-09-04 Thread Granwille Strauss

Hi

Thank you, in our case, we start our VMs at 60 GB, clients then can 
upgrade to 120 GB as the next upgrade. However, clients also have the 
option to "Downgrade" back to 60 GB based on their package. Would kinda 
not make sense to prohibit clients from doing that, from a legal POV. So 
this kinda creates an issue now and its good I tested it out now. I 
tried the 'qemu-img resize --shrink /var/lib/libvirt/images/`  
and it seems it corrupted the image file. Not sure if it had to be 
converted first maybe.


I noticed that the images are not saved as .QCOW2 files, can you perhaps 
confirm what format they're currently in? I would like to run some more 
test and maybe see how well it goes and potentially propose a solution.


On 9/4/23 17:06, Wei ZHOU wrote:

Hi,

Normally cloud providers create vm templates with small size (e.g. 10GB).
When create vm from the template, user can override the root disk size so
that vm have a larger size (e.g. 60GB)
If the vm template has cloud-init installed, it can detect the new disk
size and auto-grow the partition to use the full disk.

In your case, if users pay for only 60GB, resizing to 120GB should be
forbidden.

-Wei

On Mon, 4 Sept 2023 at 16:51, Granwille Strauss
  wrote:


Hi Wido

Thank you. Yes, I only shrink it inside the VM. But still Cloudstack
volume shows 120GB and within the VM lsblk command shows that 120 GB is
available. Since I cannot shrink the volume, how do most providers take
care of this issue? I mean it would be awkward if a client see they can
have 120 GB available when they're paying for 60 GB, for example.[image:
Powered by AdSigner]



--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by 
mistake, please inform us by email reply and then delete the message. It 
is forbidden to copy, forward, or in any way reveal the contents of this 
message to anyone without our explicit consent. The integrity and 
security of this email cannot be guaranteed over the Internet. 
Therefore, the sender will not be held liable for any damage caused by 
the message. For our full privacy policy and disclaimers, please go to 
https://www.namhost.com/privacy-policy


Powered by AdSigner 


smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to Best Shrink Volume

2023-09-04 Thread Wei ZHOU
Hi,

Normally cloud providers create vm templates with small size (e.g. 10GB).
When create vm from the template, user can override the root disk size so
that vm have a larger size (e.g. 60GB)
If the vm template has cloud-init installed, it can detect the new disk
size and auto-grow the partition to use the full disk.

In your case, if users pay for only 60GB, resizing to 120GB should be
forbidden.

-Wei

On Mon, 4 Sept 2023 at 16:51, Granwille Strauss
 wrote:

> Hi Wido
>
> Thank you. Yes, I only shrink it inside the VM. But still Cloudstack
> volume shows 120GB and within the VM lsblk command shows that 120 GB is
> available. Since I cannot shrink the volume, how do most providers take
> care of this issue? I mean it would be awkward if a client see they can
> have 120 GB available when they're paying for 60 GB, for example.[image:
> Powered by AdSigner]
> 
>


Re: How to Best Shrink Volume

2023-09-04 Thread Nux

I believe most do not allow shrinkage, simples. :)
At least the likes of Digitalocean and Hetzner do not.

Instead how you could juggle storage flexibly is by adding or removing 
data volumes and within the VM use them with LVM.



HTH

On 2023-09-04 15:50, Granwille Strauss wrote:

Hi Wido

Thank you. Yes, I only shrink it inside the VM. But still Cloudstack
volume shows 120GB and within the VM lsblk command shows that 120 GB
is available. Since I cannot shrink the volume, how do most providers
take care of this issue? I mean it would be awkward if a client see
they can have 120 GB available when they're paying for 60 GB, for
example.
On 9/4/23 15:45, Wido den Hollander wrote:


Op 04-09-2023 om 13:08 schreef Granwille Strauss:


Hi Wido

I mounted a live ISO to the VM, booted into the ISO and went into
recover mode, had to unmount the / partition of the VM, and then
proceed to resize it via parted and write changes. Rebooted via
and detatched the ISO and now VM shows 60 GB correctly. However,
in Cloudstack, still says the volume is 120 GB. But when I want to
shrink it to 60 GB, I get this error:


In this case you did not shrink the volume, but only the partition
and filesystem on the volume.

Failed to resize volume operation of volume UUID:
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink
volumes of type QCOW2


QCOW2 volumes can't be reduced in size. So no, this is not a bug.


And yes, the VM is stopped when I try doing this. I now want to
confirm from the community, is this the expected behaviour or not?
It seems Wei doubted it. If not, that means I have a bug that need
to be looked at and further checked.


Wei is correct. QCOW2 can't be shrinked.

Wido


On 9/4/23 12:46, Wido den Hollander wrote:

Op 04/09/2023 om 09:18 schreef Granwille Strauss:
Thank you. Can you confirm if this behaviour is expected? Or am I
experiencing a bug?

What exactly? You did this resize manually outside the knowledge of
cloudstack, am I correct?

How did you do this live/recovery method?

Wido

On 9/4/23 09:00, Wido den Hollander wrote:

Op 04-09-2023 om 08:20 schreef Granwille Strauss:
Hi

I managed to resize the VM itself back to 60 GB via live/recovery
method. However, now in Cloudstack it still says the volume remains
120  GB and when I want to shrink it I am presented with the errors
from my previous reply. Is there a way around this? Such as making a
database change. Also, is this the expected behaviour for a KVM
host?

This is recorded in the table 'volumes'. If you decrease the size to
60GB there is should show properly.

Wido

On 9/2/23 11:22, Granwille Strauss wrote:

Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID:
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink
volumes of type QCOW2

Going from existing size of 128849018880 to size of 64424509440
would shrink the volume.Need to sign off by supplying the shrinkok
parameter with value of true.

On 9/2/23 10:37, Wei ZHOU wrote:
Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander
wrote:

Hi,

Yes, you should make sure the filesystem and partitions are within
the
to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the

last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:
Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was
first 60
GB, we then expended it to 120 GB and increased it in the VM via
parted.
I now want to  take it back to 60GB. How do I proceed? Do I first
shrink
the ext4 in the VM first then proceed to shrink the volume in
Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps would be

appreciated, please.

--
Regards / Groete

 [1]  Granwille Strauss // Senior
Systems Admin

*e:*granwi...@namhost.com
*m:* +264 81 323 1260 [2]
*w:*www.namhost.com  [3]

 [4]
[5]<
https://www.instagram.com/namhostinternetservices/><
https://www.linkedin.com/company/namhos> [6]<
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA> [7]
<


https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner


Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA

The content of this message is confidential. If you have received it
by
mistake, please inform us by email reply and then delete the
message. It
is forbidden to copy, forward, or in any way reveal the contents of
this
message to anyone without our explicit consent. The integrity and
security o

Re: How to Best Shrink Volume

2023-09-04 Thread Granwille Strauss

Hi Wido

Thank you. Yes, I only shrink it inside the VM. But still Cloudstack 
volume shows 120GB and within the VM lsblk command shows that 120 GB is 
available. Since I cannot shrink the volume, how do most providers take 
care of this issue? I mean it would be awkward if a client see they can 
have 120 GB available when they're paying for 60 GB, for example.


On 9/4/23 15:45, Wido den Hollander wrote:



Op 04-09-2023 om 13:08 schreef Granwille Strauss:

Hi Wido

I mounted a live ISO to the VM, booted into the ISO and went into 
recover mode, had to unmount the / partition of the VM, and then 
proceed to resize it via parted and write changes. Rebooted via and 
detatched the ISO and now VM shows 60 GB correctly. However, in 
Cloudstack, still says the volume is 120 GB. But when I want to 
shrink it to 60 GB, I get this error:




In this case you did not shrink the volume, but only the partition and 
filesystem on the volume.


Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2 




QCOW2 volumes can't be reduced in size. So no, this is not a bug.

And yes, the VM is stopped when I try doing this. I now want to 
confirm from the community, is this the expected behaviour or not? It 
seems Wei doubted it. If not, that means I have a bug that need to be 
looked at and further checked.




Wei is correct. QCOW2 can't be shrinked.

Wido


On 9/4/23 12:46, Wido den Hollander wrote:



Op 04/09/2023 om 09:18 schreef Granwille Strauss:
Thank you. Can you confirm if this behaviour is expected? Or am I 
experiencing a bug?


What exactly? You did this resize manually outside the knowledge of 
cloudstack, am I correct?


How did you do this live/recovery method?

Wido



On 9/4/23 09:00, Wido den Hollander wrote:



Op 04-09-2023 om 08:20 schreef Granwille Strauss:

Hi

I managed to resize the VM itself back to 60 GB via live/recovery 
method. However, now in Cloudstack it still says the volume 
remains 120  GB and when I want to shrink it I am presented with 
the errors from my previous reply. Is there a way around this? 
Such as making a database change. Also, is this the expected 
behaviour for a KVM host?




This is recorded in the table 'volumes'. If you decrease the size 
to 60GB there is should show properly.


Wido


On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to 
shrink volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 
would shrink the volume.Need to sign off by supplying the 
shrinkok parameter with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den 
Hollander  wrote:



Hi,

Yes, you should make sure the filesystem and partitions are 
within the

to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip 
off the

last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best 
and
recommended way to shrink a VM volume via UI? The VM volume 
was first 60
GB, we then expended it to 120 GB and increased it in the VM 
via parted.
I now want to  take it back to 60GB. How do I proceed? Do I 
first shrink
the ext4 in the VM first then proceed to shrink the volume in 
Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps 
would be

appreciated, please.

--
Regards / Groete

  Granwille Strauss // Senior 
Systems Admin


*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com 

<
https://www.instagram.com/namhostinternetservices/>< 
https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<
https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner 


Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have 
received it by
mistake, please inform us by email reply and then delete the 
message. It
is forbidden to copy, forward, or in any way reveal the 
contents of this
message to anyone without our explicit consent. The integrity 
and

security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage 
caused by
the message. For our full privacy policy and disclaimers, 
please go to

https://www.namhost.com/privacy-pol

Re: How to Best Shrink Volume

2023-09-04 Thread Wido den Hollander




Op 04-09-2023 om 13:08 schreef Granwille Strauss:

Hi Wido

I mounted a live ISO to the VM, booted into the ISO and went into 
recover mode, had to unmount the / partition of the VM, and then proceed 
to resize it via parted and write changes. Rebooted via and detatched 
the ISO and now VM shows 60 GB correctly. However, in Cloudstack, still 
says the volume is 120 GB. But when I want to shrink it to 60 GB, I get 
this error:




In this case you did not shrink the volume, but only the partition and 
filesystem on the volume.


Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2 




QCOW2 volumes can't be reduced in size. So no, this is not a bug.

And yes, the VM is stopped when I try doing this. I now want to confirm 
from the community, is this the expected behaviour or not? It seems Wei 
doubted it. If not, that means I have a bug that need to be looked at 
and further checked.




Wei is correct. QCOW2 can't be shrinked.

Wido


On 9/4/23 12:46, Wido den Hollander wrote:



Op 04/09/2023 om 09:18 schreef Granwille Strauss:
Thank you. Can you confirm if this behaviour is expected? Or am I 
experiencing a bug?


What exactly? You did this resize manually outside the knowledge of 
cloudstack, am I correct?


How did you do this live/recovery method?

Wido



On 9/4/23 09:00, Wido den Hollander wrote:



Op 04-09-2023 om 08:20 schreef Granwille Strauss:

Hi

I managed to resize the VM itself back to 60 GB via live/recovery 
method. However, now in Cloudstack it still says the volume remains 
120  GB and when I want to shrink it I am presented with the errors 
from my previous reply. Is there a way around this? Such as making 
a database change. Also, is this the expected behaviour for a KVM 
host?




This is recorded in the table 'volumes'. If you decrease the size to 
60GB there is should show properly.


Wido


On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 
would shrink the volume.Need to sign off by supplying the 
shrinkok parameter with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  
wrote:



Hi,

Yes, you should make sure the filesystem and partitions are 
within the

to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off 
the

last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was 
first 60
GB, we then expended it to 120 GB and increased it in the VM 
via parted.
I now want to  take it back to 60GB. How do I proceed? Do I 
first shrink
the ext4 in the VM first then proceed to shrink the volume in 
Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps 
would be

appreciated, please.

--
Regards / Groete

  Granwille Strauss // Senior 
Systems Admin


*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com 

<
https://www.instagram.com/namhostinternetservices/>< 
https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<

https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner

Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have 
received it by
mistake, please inform us by email reply and then delete the 
message. It
is forbidden to copy, forward, or in any way reveal the 
contents of this

message to anyone without our explicit consent. The integrity and
security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage 
caused by
the message. For our full privacy policy and disclaimers, 
please go to

https://www.namhost.com/privacy-policy

Powered by AdSigner
<

https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818

--
Regards / Groete

 Granwille Strauss  // Senior Systems 
Admin


*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 



Re: How to Best Shrink Volume

2023-09-04 Thread Granwille Strauss

Hi Wei


As far as I understand, you have resized the disk inside the VM to 60GB,
right ?

- Yes, I have resized the partitions in VM back to 60 GB.


However, the allocated disk size of the VM should be still 120GB, not 60GB.
You can verify it by `qemu-img info -U /mnt//`

- Yes, in VM if I run 'lsblk' I see this:

vda    253:0    0  120G  0 disk
├─vda1 253:1    0   57G  0 part /
├─vda2 253:2    0    2G  0 part [SWAP]
└─vda3 253:3    0    1G  0 part /boot

root@hostname /var/lib/libvirt/images $ qemu-img info -U 
/var/lib/libvirt/images/c611907d-4168-4436-b928-d51ef98ea8e7

image: /var/lib/libvirt/images/c611907d-4168-4436-b928-d51ef98ea8e7
file format: qcow2
virtual size: 120 GiB (128849018880 bytes)
disk size: 59.2 GiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false



Shrinking a QCOW2 image is possible, but complicated. It is currently not
supported by CloudStack. The message you received is expected.


- Thank you for the confirmation. What is the standard practise that 
most providers do in this case?


On 9/4/23 13:38, Wei ZHOU wrote:

Hi,

As far as I understand, you have resized the disk inside the VM to 60GB,
right ?

However, the allocated disk size of the VM should be still 120GB, not 60GB.
You can verify it by `qemu-img info -U /mnt//`

Shrinking a QCOW2 image is possible, but complicated. It is currently not
supported by CloudStack. The message you received is expected.


-Wei


On Mon, 4 Sept 2023 at 13:11, Granwille Strauss
  wrote:


Hi Wido

I mounted a live ISO to the VM, booted into the ISO and went into recover
mode, had to unmount the / partition of the VM, and then proceed to resize
it via parted and write changes. Rebooted via and detatched the ISO and now
VM shows 60 GB correctly. However, in Cloudstack, still says the volume is
120 GB. But when I want to shrink it to 60 GB, I get this error:

Failed to resize volume operation of volume UUID:
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink volumes of
type QCOW2

And yes, the VM is stopped when I try doing this. I now want to confirm
from the community, is this the expected behaviour or not? It seems Wei
doubted it. If not, that means I have a bug that need to be looked at and
further checked.

On 9/4/23 12:46, Wido den Hollander wrote:



Op 04/09/2023 om 09:18 schreef Granwille Strauss:

Thank you. Can you confirm if this behaviour is expected? Or am I
experiencing a bug?


What exactly? You did this resize manually outside the knowledge of
cloudstack, am I correct?

How did you do this live/recovery method?

Wido


On 9/4/23 09:00, Wido den Hollander wrote:



Op 04-09-2023 om 08:20 schreef Granwille Strauss:

Hi

I managed to resize the VM itself back to 60 GB via live/recovery method.
However, now in Cloudstack it still says the volume remains 120  GB and
when I want to shrink it I am presented with the errors from my previous
reply. Is there a way around this? Such as making a database change. Also,
is this the expected behaviour for a KVM host?


This is recorded in the table 'volumes'. If you decrease the size to 60GB
there is should show properly.

Wido

On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID:
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink volumes of
type QCOW2


Going from existing size of 128849018880 to size of 64424509440 would
shrink the volume.Need to sign off by supplying the shrinkok parameter with
value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander
   wrote:

Hi,

Yes, you should make sure the filesystem and partitions are within the
to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the
last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was first 60
GB, we then expended it to 120 GB and increased it in the VM via parted.
I now want to  take it back to 60GB. How do I proceed? Do I first shrink
the ext4 in the VM first then proceed to shrink the volume in Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps would be
appreciated, please.

--
Regards / Groete

     Granwille
Strauss // Senior Systems Admin

*e:*granwi...@namhost.com
*m:* +264 81 323 1260  <+264813231260>
*w:*www.namhost.com

Re: How to Best Shrink Volume

2023-09-04 Thread Wei ZHOU
Hi,

As far as I understand, you have resized the disk inside the VM to 60GB,
right ?

However, the allocated disk size of the VM should be still 120GB, not 60GB.
You can verify it by `qemu-img info -U /mnt//`

Shrinking a QCOW2 image is possible, but complicated. It is currently not
supported by CloudStack. The message you received is expected.


-Wei


On Mon, 4 Sept 2023 at 13:11, Granwille Strauss
 wrote:

> Hi Wido
>
> I mounted a live ISO to the VM, booted into the ISO and went into recover
> mode, had to unmount the / partition of the VM, and then proceed to resize
> it via parted and write changes. Rebooted via and detatched the ISO and now
> VM shows 60 GB correctly. However, in Cloudstack, still says the volume is
> 120 GB. But when I want to shrink it to 60 GB, I get this error:
>
> Failed to resize volume operation of volume UUID:
> [eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink volumes of
> type QCOW2
>
> And yes, the VM is stopped when I try doing this. I now want to confirm
> from the community, is this the expected behaviour or not? It seems Wei
> doubted it. If not, that means I have a bug that need to be looked at and
> further checked.
>
> On 9/4/23 12:46, Wido den Hollander wrote:
>
>
>
> Op 04/09/2023 om 09:18 schreef Granwille Strauss:
>
> Thank you. Can you confirm if this behaviour is expected? Or am I
> experiencing a bug?
>
>
> What exactly? You did this resize manually outside the knowledge of
> cloudstack, am I correct?
>
> How did you do this live/recovery method?
>
> Wido
>
>
> On 9/4/23 09:00, Wido den Hollander wrote:
>
>
>
> Op 04-09-2023 om 08:20 schreef Granwille Strauss:
>
> Hi
>
> I managed to resize the VM itself back to 60 GB via live/recovery method.
> However, now in Cloudstack it still says the volume remains 120  GB and
> when I want to shrink it I am presented with the errors from my previous
> reply. Is there a way around this? Such as making a database change. Also,
> is this the expected behaviour for a KVM host?
>
>
> This is recorded in the table 'volumes'. If you decrease the size to 60GB
> there is should show properly.
>
> Wido
>
> On 9/2/23 11:22, Granwille Strauss wrote:
>
>
> Hi Wei
>
> It seems you're right you cannot shrink the volume in Cloudstack:
>
> Failed to resize volume operation of volume UUID:
> [eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink volumes of
> type QCOW2
>
>
> Going from existing size of 128849018880 to size of 64424509440 would
> shrink the volume.Need to sign off by supplying the shrinkok parameter with
> value of true.
>
>
> On 9/2/23 10:37, Wei ZHOU wrote:
>
> Hi Wido,
>
> Does it work with kvm ?
>
> my suggestion would be
> - create a new vm with 60GB
> - copy the data using `rsync`
>
> -Wei
>
> On Sat, 2 Sept 2023 at 08:25, Wido den Hollander
>   wrote:
>
> Hi,
>
> Yes, you should make sure the filesystem and partitions are within the
> to be set new boundaries.
>
> Once that's done you can shrink the volume.
>
> I would recommend:
>
> - Shrink EXT4 + Partitions to 59GB
> - Shrink volume to 60GB
> - Grow EXT4 + Partitions to 60GB
>
> The step to 59GB is to prevent that by calc mistake you chip off the
> last portion of your filesystem.
>
> Wido
>
> Op 01-09-2023 om 16:29 schreef Granwille Strauss:
>
> Hi Guys
>
> Anyone willing to assist me with a quick one. What's the best and
> recommended way to shrink a VM volume via UI? The VM volume was first 60
> GB, we then expended it to 120 GB and increased it in the VM via parted.
> I now want to  take it back to 60GB. How do I proceed? Do I first shrink
> the ext4 in the VM first then proceed to shrink the volume in Cloudstack
> UI by selecting also the "Shrink OK" option? Detailed steps would be
> appreciated, please.
>
> --
> Regards / Groete
>
>    Granwille
> Strauss // Senior Systems Admin
>
> *e:*granwi...@namhost.com
> *m:* +264 81 323 1260 <+264813231260>
> *w:*www.namhost.com  
>
>  
>  <
>
> https://www.instagram.com/namhostinternetservices/><
> https://www.linkedin.com/company/namhos>
> <
> https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>
> 
>
> <
>
>
> https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner
>
> Namhost Internet Services (Pty) Ltd,
>
> 24 Black Eagle Rd, Hermanus, 7210, RSA
>
>
>
> The content of this message is confidential. If you have received it by
> mistake, please inform us by email reply and then delete the message. It
> is forbidden to copy, forward, or in any way reveal the contents of this
> message to anyone without our explicit consent. The integrity and
> security of this email cannot be guaranteed over the Internet.
> Therefore, th

Re: How to Best Shrink Volume

2023-09-04 Thread Granwille Strauss

Hi Wido

I mounted a live ISO to the VM, booted into the ISO and went into 
recover mode, had to unmount the / partition of the VM, and then proceed 
to resize it via parted and write changes. Rebooted via and detatched 
the ISO and now VM shows 60 GB correctly. However, in Cloudstack, still 
says the volume is 120 GB. But when I want to shrink it to 60 GB, I get 
this error:


Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2 


And yes, the VM is stopped when I try doing this. I now want to confirm 
from the community, is this the expected behaviour or not? It seems Wei 
doubted it. If not, that means I have a bug that need to be looked at 
and further checked.


On 9/4/23 12:46, Wido den Hollander wrote:



Op 04/09/2023 om 09:18 schreef Granwille Strauss:
Thank you. Can you confirm if this behaviour is expected? Or am I 
experiencing a bug?


What exactly? You did this resize manually outside the knowledge of 
cloudstack, am I correct?


How did you do this live/recovery method?

Wido



On 9/4/23 09:00, Wido den Hollander wrote:



Op 04-09-2023 om 08:20 schreef Granwille Strauss:

Hi

I managed to resize the VM itself back to 60 GB via live/recovery 
method. However, now in Cloudstack it still says the volume remains 
120  GB and when I want to shrink it I am presented with the errors 
from my previous reply. Is there a way around this? Such as making 
a database change. Also, is this the expected behaviour for a KVM 
host?




This is recorded in the table 'volumes'. If you decrease the size to 
60GB there is should show properly.


Wido


On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 
would shrink the volume.Need to sign off by supplying the 
shrinkok parameter with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  
wrote:



Hi,

Yes, you should make sure the filesystem and partitions are 
within the

to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off 
the

last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was 
first 60
GB, we then expended it to 120 GB and increased it in the VM 
via parted.
I now want to  take it back to 60GB. How do I proceed? Do I 
first shrink
the ext4 in the VM first then proceed to shrink the volume in 
Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps 
would be

appreciated, please.

--
Regards / Groete

  Granwille Strauss // Senior 
Systems Admin


*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com 

<
https://www.instagram.com/namhostinternetservices/>< 
https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<
https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner 


Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have 
received it by
mistake, please inform us by email reply and then delete the 
message. It
is forbidden to copy, forward, or in any way reveal the 
contents of this

message to anyone without our explicit consent. The integrity and
security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage 
caused by
the message. For our full privacy policy and disclaimers, 
please go to

https://www.namhost.com/privacy-policy

Powered by AdSigner
<
https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818 


--
Regards / Groete

 Granwille Strauss  // Senior Systems 
Admin


*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 

 



 



Namhost Internet Services (Pty) Ltd,
24 Black Eagle Rd, Hermanus, 721

Re: How to Best Shrink Volume

2023-09-04 Thread Wido den Hollander




Op 04/09/2023 om 09:18 schreef Granwille Strauss:
Thank you. Can you confirm if this behaviour is expected? Or am I 
experiencing a bug?


What exactly? You did this resize manually outside the knowledge of 
cloudstack, am I correct?


How did you do this live/recovery method?

Wido



On 9/4/23 09:00, Wido den Hollander wrote:



Op 04-09-2023 om 08:20 schreef Granwille Strauss:

Hi

I managed to resize the VM itself back to 60 GB via live/recovery 
method. However, now in Cloudstack it still says the volume remains 
120  GB and when I want to shrink it I am presented with the errors 
from my previous reply. Is there a way around this? Such as making a 
database change. Also, is this the expected behaviour for a KVM host?




This is recorded in the table 'volumes'. If you decrease the size to 
60GB there is should show properly.


Wido


On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 
would shrink the volume.Need to sign off by supplying the shrinkok 
parameter with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  
wrote:



Hi,

Yes, you should make sure the filesystem and partitions are within 
the

to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the
last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was 
first 60
GB, we then expended it to 120 GB and increased it in the VM via 
parted.
I now want to  take it back to 60GB. How do I proceed? Do I first 
shrink
the ext4 in the VM first then proceed to shrink the volume in 
Cloudstack

UI by selecting also the "Shrink OK" option? Detailed steps would be
appreciated, please.

--
Regards / Groete

  Granwille Strauss // Senior 
Systems Admin


*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com 

<
https://www.instagram.com/namhostinternetservices/>< 
https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<

https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner

Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received 
it by
mistake, please inform us by email reply and then delete the 
message. It
is forbidden to copy, forward, or in any way reveal the contents 
of this

message to anyone without our explicit consent. The integrity and
security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage 
caused by
the message. For our full privacy policy and disclaimers, please 
go to

https://www.namhost.com/privacy-policy

Powered by AdSigner
<

https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818

--
Regards / Groete

 Granwille Strauss  // Senior Systems 
Admin


*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,
24 Black Eagle Rd, Hermanus, 7210, RSA


The content of this message is confidential. If you have received it 
by mistake, please inform us by email reply and then delete the 
message. It is forbidden to copy, forward, or in any way reveal the 
contents of this message to anyone without our explicit consent. The 
integrity and security of this email cannot be guaranteed over the 
Internet. Therefore, the sender will not be held liable for any 
damage caused by the message. For our full privacy policy and 
disclaimers, please go to https://www.namhost.com/privacy-policy


Powered by AdSigner 


--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 

Re: How to Best Shrink Volume

2023-09-04 Thread Granwille Strauss
Thank you. Can you confirm if this behaviour is expected? Or am I 
experiencing a bug?


On 9/4/23 09:00, Wido den Hollander wrote:



Op 04-09-2023 om 08:20 schreef Granwille Strauss:

Hi

I managed to resize the VM itself back to 60 GB via live/recovery 
method. However, now in Cloudstack it still says the volume remains 
120  GB and when I want to shrink it I am presented with the errors 
from my previous reply. Is there a way around this? Such as making a 
database change. Also, is this the expected behaviour for a KVM host?




This is recorded in the table 'volumes'. If you decrease the size to 
60GB there is should show properly.


Wido


On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 
would shrink the volume.Need to sign off by supplying the shrinkok 
parameter with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  
wrote:



Hi,

Yes, you should make sure the filesystem and partitions are within 
the

to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the
last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was 
first 60
GB, we then expended it to 120 GB and increased it in the VM via 
parted.
I now want to  take it back to 60GB. How do I proceed? Do I first 
shrink
the ext4 in the VM first then proceed to shrink the volume in 
Cloudstack

UI by selecting also the "Shrink OK" option? Detailed steps would be
appreciated, please.

--
Regards / Groete

  Granwille Strauss // Senior 
Systems Admin


*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com 

<
https://www.instagram.com/namhostinternetservices/>< 
https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<
https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner 


Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received 
it by
mistake, please inform us by email reply and then delete the 
message. It
is forbidden to copy, forward, or in any way reveal the contents 
of this

message to anyone without our explicit consent. The integrity and
security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage 
caused by
the message. For our full privacy policy and disclaimers, please 
go to

https://www.namhost.com/privacy-policy

Powered by AdSigner
<
https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818 


--
Regards / Groete

 Granwille Strauss  // Senior Systems 
Admin


*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 

 



 



Namhost Internet Services (Pty) Ltd,
24 Black Eagle Rd, Hermanus, 7210, RSA


The content of this message is confidential. If you have received it 
by mistake, please inform us by email reply and then delete the 
message. It is forbidden to copy, forward, or in any way reveal the 
contents of this message to anyone without our explicit consent. The 
integrity and security of this email cannot be guaranteed over the 
Internet. Therefore, the sender will not be held liable for any 
damage caused by the message. For our full privacy policy and 
disclaimers, please go to https://www.namhost.com/privacy-policy


Powered by AdSigner 


--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 



Re: How to Best Shrink Volume

2023-09-04 Thread Wido den Hollander




Op 04-09-2023 om 08:20 schreef Granwille Strauss:

Hi

I managed to resize the VM itself back to 60 GB via live/recovery 
method. However, now in Cloudstack it still says the volume remains 120  
GB and when I want to shrink it I am presented with the errors from my 
previous reply. Is there a way around this? Such as making a database 
change. Also, is this the expected behaviour for a KVM host?




This is recorded in the table 'volumes'. If you decrease the size to 
60GB there is should show properly.


Wido


On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 would 
shrink the volume.Need to sign off by supplying the shrinkok 
parameter with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  wrote:


Hi,

Yes, you should make sure the filesystem and partitions are within the
to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the
last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was first 60
GB, we then expended it to 120 GB and increased it in the VM via parted.
I now want to  take it back to 60GB. How do I proceed? Do I first shrink
the ext4 in the VM first then proceed to shrink the volume in Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps would be
appreciated, please.

--
Regards / Groete

  Granwille Strauss  // Senior Systems Admin

*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com  

<
https://www.instagram.com/namhostinternetservices/>< https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<

https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner

Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by
mistake, please inform us by email reply and then delete the message. It
is forbidden to copy, forward, or in any way reveal the contents of this
message to anyone without our explicit consent. The integrity and
security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage caused by
the message. For our full privacy policy and disclaimers, please go to
https://www.namhost.com/privacy-policy

Powered by AdSigner
<

https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818

--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,
24 Black Eagle Rd, Hermanus, 7210, RSA


The content of this message is confidential. If you have received it 
by mistake, please inform us by email reply and then delete the 
message. It is forbidden to copy, forward, or in any way reveal the 
contents of this message to anyone without our explicit consent. The 
integrity and security of this email cannot be guaranteed over the 
Internet. Therefore, the sender will not be held liable for any damage 
caused by the message. For our full privacy policy and disclaimers, 
please go to https://www.namhost.com/privacy-policy


Powered by AdSigner 


--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Inte

Re: How to Best Shrink Volume

2023-09-03 Thread Granwille Strauss

Hi

I managed to resize the VM itself back to 60 GB via live/recovery 
method. However, now in Cloudstack it still says the volume remains 120  
GB and when I want to shrink it I am presented with the errors from my 
previous reply. Is there a way around this? Such as making a database 
change. Also, is this the expected behaviour for a KVM host?


On 9/2/23 11:22, Granwille Strauss wrote:


Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 would 
shrink the volume.Need to sign off by supplying the shrinkok 
parameter with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  wrote:


Hi,

Yes, you should make sure the filesystem and partitions are within the
to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the
last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was first 60
GB, we then expended it to 120 GB and increased it in the VM via parted.
I now want to  take it back to 60GB. How do I proceed? Do I first shrink
the ext4 in the VM first then proceed to shrink the volume in Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps would be
appreciated, please.

--
Regards / Groete

  Granwille Strauss  // Senior Systems Admin

*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com  

<
https://www.instagram.com/namhostinternetservices/>< https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<

https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner

Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by
mistake, please inform us by email reply and then delete the message. It
is forbidden to copy, forward, or in any way reveal the contents of this
message to anyone without our explicit consent. The integrity and
security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage caused by
the message. For our full privacy policy and disclaimers, please go to
https://www.namhost.com/privacy-policy

Powered by AdSigner
<

https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818

--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,
24 Black Eagle Rd, Hermanus, 7210, RSA


The content of this message is confidential. If you have received it 
by mistake, please inform us by email reply and then delete the 
message. It is forbidden to copy, forward, or in any way reveal the 
contents of this message to anyone without our explicit consent. The 
integrity and security of this email cannot be guaranteed over the 
Internet. Therefore, the sender will not be held liable for any damage 
caused by the message. For our full privacy policy and disclaimers, 
please go to https://www.namhost.com/privacy-policy


Powered by AdSigner 


--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by 
mistake, please inform us by e

Re: How to Best Shrink Volume

2023-09-02 Thread Granwille Strauss

Hi Wei

It seems you're right you cannot shrink the volume in Cloudstack:

Failed to resize volume operation of volume UUID: 
[eec8285e-8715-441b-b418-b71b231f1bab] due to - Unable to shrink 
volumes of type QCOW2


Going from existing size of 128849018880 to size of 64424509440 would 
shrink the volume.Need to sign off by supplying the shrinkok parameter 
with value of true.


On 9/2/23 10:37, Wei ZHOU wrote:

Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  wrote:


Hi,

Yes, you should make sure the filesystem and partitions are within the
to be set new boundaries.

Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the
last portion of your filesystem.

Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and
recommended way to shrink a VM volume via UI? The VM volume was first 60
GB, we then expended it to 120 GB and increased it in the VM via parted.
I now want to  take it back to 60GB. How do I proceed? Do I first shrink
the ext4 in the VM first then proceed to shrink the volume in Cloudstack
UI by selecting also the "Shrink OK" option? Detailed steps would be
appreciated, please.

--
Regards / Groete

  Granwille Strauss  // Senior Systems Admin

*e:*granwi...@namhost.com
*m:* +264 81 323 1260
*w:*www.namhost.com  

<
https://www.instagram.com/namhostinternetservices/>< https://www.linkedin.com/company/namhos>< 
https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>

<

https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner


Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by
mistake, please inform us by email reply and then delete the message. It
is forbidden to copy, forward, or in any way reveal the contents of this
message to anyone without our explicit consent. The integrity and
security of this email cannot be guaranteed over the Internet.
Therefore, the sender will not be held liable for any damage caused by
the message. For our full privacy policy and disclaimers, please go to
https://www.namhost.com/privacy-policy

Powered by AdSigner
<

https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818

--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by 
mistake, please inform us by email reply and then delete the message. It 
is forbidden to copy, forward, or in any way reveal the contents of this 
message to anyone without our explicit consent. The integrity and 
security of this email cannot be guaranteed over the Internet. 
Therefore, the sender will not be held liable for any damage caused by 
the message. For our full privacy policy and disclaimers, please go to 
https://www.namhost.com/privacy-policy


Powered by AdSigner 


smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to Best Shrink Volume

2023-09-02 Thread Wei ZHOU
Hi Wido,

Does it work with kvm ?

my suggestion would be
- create a new vm with 60GB
- copy the data using `rsync`

-Wei

On Sat, 2 Sept 2023 at 08:25, Wido den Hollander  wrote:

> Hi,
>
> Yes, you should make sure the filesystem and partitions are within the
> to be set new boundaries.
>
> Once that's done you can shrink the volume.
>
> I would recommend:
>
> - Shrink EXT4 + Partitions to 59GB
> - Shrink volume to 60GB
> - Grow EXT4 + Partitions to 60GB
>
> The step to 59GB is to prevent that by calc mistake you chip off the
> last portion of your filesystem.
>
> Wido
>
> Op 01-09-2023 om 16:29 schreef Granwille Strauss:
> > Hi Guys
> >
> > Anyone willing to assist me with a quick one. What's the best and
> > recommended way to shrink a VM volume via UI? The VM volume was first 60
> > GB, we then expended it to 120 GB and increased it in the VM via parted.
> > I now want to  take it back to 60GB. How do I proceed? Do I first shrink
> > the ext4 in the VM first then proceed to shrink the volume in Cloudstack
> > UI by selecting also the "Shrink OK" option? Detailed steps would be
> > appreciated, please.
> >
> > --
> > Regards / Groete
> >
> >  Granwille Strauss  // Senior Systems Admin
> >
> > *e:* granwi...@namhost.com
> > *m:* +264 81 323 1260 
> > *w:* www.namhost.com 
> >
> > <
> https://www.instagram.com/namhostinternetservices/><
> https://www.linkedin.com/company/namhos><
> https://www.youtube.com/channel/UCTd5v-kVPaic_dguGur15AA>
> >
> > <
> https://www.adsigner.com/v1/l/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818/banner
> >
> >
> > Namhost Internet Services (Pty) Ltd,
> >
> > 24 Black Eagle Rd, Hermanus, 7210, RSA
> >
> >
> >
> > The content of this message is confidential. If you have received it by
> > mistake, please inform us by email reply and then delete the message. It
> > is forbidden to copy, forward, or in any way reveal the contents of this
> > message to anyone without our explicit consent. The integrity and
> > security of this email cannot be guaranteed over the Internet.
> > Therefore, the sender will not be held liable for any damage caused by
> > the message. For our full privacy policy and disclaimers, please go to
> > https://www.namhost.com/privacy-policy
> >
> > Powered by AdSigner
> > <
> https://www.adsigner.com/v1/c/631091998d4670001fe43ec2/621c9b76c140bb001ed0f818
> >
>


Re: How to Best Shrink Volume

2023-09-02 Thread Granwille Strauss

Thank you Wido

I appreciate your feedback.

On 9/2/23 08:24, Wido den Hollander wrote:

Hi,

Yes, you should make sure the filesystem and partitions are within the 
to be set new boundaries.


Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the 
last portion of your filesystem.


Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and 
recommended way to shrink a VM volume via UI? The VM volume was first 
60 GB, we then expended it to 120 GB and increased it in the VM via 
parted. I now want to  take it back to 60GB. How do I proceed? Do I 
first shrink the ext4 in the VM first then proceed to shrink the 
volume in Cloudstack UI by selecting also the "Shrink OK" option? 
Detailed steps would be appreciated, please.


--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 

 



 



Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it 
by mistake, please inform us by email reply and then delete the 
message. It is forbidden to copy, forward, or in any way reveal the 
contents of this message to anyone without our explicit consent. The 
integrity and security of this email cannot be guaranteed over the 
Internet. Therefore, the sender will not be held liable for any 
damage caused by the message. For our full privacy policy and 
disclaimers, please go to https://www.namhost.com/privacy-policy


Powered by AdSigner 


--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by 
mistake, please inform us by email reply and then delete the message. It 
is forbidden to copy, forward, or in any way reveal the contents of this 
message to anyone without our explicit consent. The integrity and 
security of this email cannot be guaranteed over the Internet. 
Therefore, the sender will not be held liable for any damage caused by 
the message. For our full privacy policy and disclaimers, please go to 
https://www.namhost.com/privacy-policy


Powered by AdSigner 


smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to Best Shrink Volume

2023-09-01 Thread Wido den Hollander

Hi,

Yes, you should make sure the filesystem and partitions are within the 
to be set new boundaries.


Once that's done you can shrink the volume.

I would recommend:

- Shrink EXT4 + Partitions to 59GB
- Shrink volume to 60GB
- Grow EXT4 + Partitions to 60GB

The step to 59GB is to prevent that by calc mistake you chip off the 
last portion of your filesystem.


Wido

Op 01-09-2023 om 16:29 schreef Granwille Strauss:

Hi Guys

Anyone willing to assist me with a quick one. What's the best and 
recommended way to shrink a VM volume via UI? The VM volume was first 60 
GB, we then expended it to 120 GB and increased it in the VM via parted. 
I now want to  take it back to 60GB. How do I proceed? Do I first shrink 
the ext4 in the VM first then proceed to shrink the volume in Cloudstack 
UI by selecting also the "Shrink OK" option? Detailed steps would be 
appreciated, please.


--
Regards / Groete

 Granwille Strauss  // Senior Systems Admin

*e:* granwi...@namhost.com
*m:* +264 81 323 1260 
*w:* www.namhost.com 





Namhost Internet Services (Pty) Ltd,

24 Black Eagle Rd, Hermanus, 7210, RSA



The content of this message is confidential. If you have received it by 
mistake, please inform us by email reply and then delete the message. It 
is forbidden to copy, forward, or in any way reveal the contents of this 
message to anyone without our explicit consent. The integrity and 
security of this email cannot be guaranteed over the Internet. 
Therefore, the sender will not be held liable for any damage caused by 
the message. For our full privacy policy and disclaimers, please go to 
https://www.namhost.com/privacy-policy


Powered by AdSigner