3

VMWare: Shrink image even though it’s a snapshot

 2 years ago
source link: https://blog.jakubholy.net/2007/08/21/vmware-shrink-image-even-though-it/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

VMWare: Shrink image even though it’s a snapshot

August 21, 2007
I needed to shrink a vmware image to save space but it wasn't possible because it wasn't an independent disk but a snapshot (rhel3_ws_u4-000001.vmdk etc.) dependant upon the original disk (rhel3_ws_u4-s001.vmdk etc). The steps were:
  1. Join the snapshot and the parent disk into one: use the free VMWare Converter (see vmware.com) - perform transformation (import+export) from a standalone virt. machine to an stanalone virt. machine; it's necessary to import all the disk, preserving its size (by selecting "select volumes and resize..." I got an unbootable disk); than check "Create a full clone" and "Allow virtual disk files to grow" (don't pre-allocate space!!!).
  2. Shrink: After the successfull conversion run the system and verify that the disk is of the type independant-persistent and perhaps disable snapshots). Iinstall there vmware tools (from the vmware menu while the system is running), run the command vmware-toolbox and in its user interface select "shrink disk".
Tags: DevOps

Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.

Allow me to write to you!

Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK