Creating a new App Volumes AppStack template VMDK changing the default size of 20 GB
search cancel

Creating a new App Volumes AppStack template VMDK changing the default size of 20 GB

book

Article ID: 344361

calendar_today

Updated On:

Products

VMware

Issue/Introduction

This article provides information on creating a new App Volumes AppStack/Package template VMDK changing the default size of 20 GB


Environment

VMware App Volumes 4.x
VMware App Volumes 2.14.x
VMware App Volumes 2.15.x
VMware App Volumes 2.13.x
VMware App Volumes 2.16.x
VMware App Volumes 2.12.x
VMware App Volumes 2.17.x
VMware App Volumes 2.18.x

Cause

Note, the default template size of 20GB should be sufficient for the majority of modern applications.

Resolution

To create a new AppStack/Package template VMDK:
 
  1. Use a clean Windows virtual machine without the App Volumes agent installed. This can be any Windows virtual machine that meets the minimum requirements for a clean machine.

    For more information on a clean machine (clean base image), see the Working with AppStacks section in the VMware App Volumes User Guide.

    Note: VMware recommends using a Windows 7 or Windows 8 virtual machine to create a new template disk, as this works for Windows 7, Windows 8, and later operating systems.
     
  2. Create a new thin-provisioned disk in the Windows virtual machine and specify the new size (for example, 1 GB, 5 GB, 40 GB, and so on). | Go to Actions on the VM interface > Edit Settings. Add a new thin-provisioned disk and specify the new size.

    For more information, see the Create Thin Provisioned Virtual Disks in the vSphere Web Client section in the vSphere Storage Guide.

    Note: The AppStack/Package size must be at least the minimum application requirements and space needed for temporary installation files during the application install process. For example, Adobe Reader 11 has a 384 MB minimum available disk size, but requires more than 512 MB free to install, or the installation will fail.
  3. Attach the existing template.vmdk file found in the /cloudvolumes/apps_templates/ or /appvolumes/packages_templates folder to the Windows virtual machine. 
  1. From the vSphere Web Client, ensure that the virtual machine is powered off.
  2. Select Actions > Edit Settings.
  3. From the Virtual Hardware tab, in the New device drop-down, select Existing Hard Disk.
  4. Click Add.
  5. Navigate to the below location according to your App Volumes version and select the template.vmdk file

For App Volumes 2.x

datastore/cloudvolumes/apps_templates/template.vmdk

For App Volumes 4.x

datastore/appvolumes/packages_templates/template.vmdk
  1. Click OK. 
  2. Click OK in the Edit Settings window.

Notes:
  • This locks the template.vmdk file until it is removed from the virtual machine.
  • Although CloudVolumes is the legacy name, the folder path is still used for ease of upgrades from the older CloudVolumes to newer VMware App Volumes.
  • You can use a copy of the template if that is your preference: https://kb.vmware.com/s/article/1028042
  • If the VM fails to power on or existing template fails to attach to VM this can be due to the ddb.deletable descriptor of the VMDK being set to false.  Changing this to true will allow power on and attachment:
  1. To attach the VMDK file to the Windows virtual machine:
     
  2. Within the Windows virtual machine, perform these steps:
     
    1. Initialize the new drive. This is the new thin-provisioned drive, not the template.vmdk.

      To initialize the new drive:
       
      1. Run compmgmt.msc from the command line to open Computer Management.
      2. From the left navigation pane, select Storage > Disk Management. The Initialize Disk window launches automatically.
      3. Initialize the new drive by selecting MBR (Master Boot Record) and then click OK.


         
      4. Right-click the new disk and click New Simple Volume.
      5. Navigate through the New Simple Volume wizard, click Next and specify volume size and a drive letter.
      6. In the Format Partition window, set File System to NTFS, set Volume label to CVApps (same as the existing template), and select Perform a quick format and then click Next and Finish.


         
    2. Unhide system files and folders:
       
      1. Open the Control Panel, and select Appearance and Personalization.
      2. Click Show hidden files and folders to open the Folder Options window.
      3. Select Show hidden files, folders, and drives.
      4. Ensure that these options are not selected:
         
        • Hide empty drives in the Computer folder
        • Hide extensions for known file types
        • Hide protected operating system files (Recommended)


           
    3. Copy all contents (including hidden and system files and folders) to the new VMDK.

      To copy all contents (including hidden and system files and folders) to the new VMDK:
       
      1. Open Windows Explorer, and select the existing drive, for example, CVApps(E:).
      2. Copy all the files and folders from CVApps(E:) in to the new drive. For example, CVApps(G:).

  3. On the newly created VMDK do the following :   
    1.   Login to diskmgmt.msc and unassign the drive letter and unmount the vmdk 
    2.   Set attribute NODEFAULTDRIVELETTER by following steps below:
      1. Launch CMD as administrator and run the following commands:
      2. diskpart
      3. list volume
      4. select volume volume_number
      5. attributes volume set NODEFAULTDRIVELETTER
  4. Detach both VMDKs (the newly created one and the AppStack/Package template.vmdk file) from the Windows virtual machine. 
    1. From the vSphere Web Client, power off the virtual machine.
    2. Select Actions > Edit Settings.
    3. Click the right arrow to the left of the new hard disk. The path to the disk is displayed in the format:

      datastore/path/vmdk_file

      Make a note of the path to the new hard disk.
       
    4. Hover the mouse to the far right of the hard disk to be removed, and x appears. Click x.

      The text Device will be removed and checkbox to Delete files from datastore appears.
       
    5. Click OK.


      Note: Do not check the box Delete files from datastore.

      rtaImage1.png
  5. Use SSH to copy the newly created VMDK (both the flat and stub files) from its current location (the virtual machine folder or another location) in to the /cloudvolumes/apps_templates/ or /appvolumes/packages_templates folder.

    To copy the VMDK files using SSH:
     
    1. Launch SSH console.
    2. Copy the VMDK files using this example command:

      mv /vmfs/volumes/datastore/new_VMDK_file*.vmdk /vmfs/volumes/datastore/cloudvolumes/apps_templates/

      Notes:
      • You can use PuTTY instead of the previous SSH commands. VMware does not recommends to use the vSphere Web Client to export the disk, as the thin-provisioned disk will expand to full size.
      • To ensure that your disk remains thin-provisioned after moving VMDK files with command line or automated storage controls in App Volumes, use the vmkfstools command with the –K option. This is an example command:

        vmkfstools –K AppStack_Template_Name.vmdk

        This option deallocates all zeroed out blocks and leaves only those blocks that were allocated previously and contain valid data. The resulting virtual disk is in thin format.
         
  6. (Optional) Rename the VMDK as desired. You can use SSH to perform this task.

    To rename the VMDK using SSH:
     
    1. Launch an SSH console, and navigate to the VMDK location:

      cd /vmfs/volumes/datastore/cloudvolumes/apps_templates

    2. Rename the stub and flat files using these example commands:

      mv OldName.vmdk NewName.vmdk
      mv OldName-flat.vmdk NewName-flat.vmdk

    3. Edit the stub VMDK file using a text editor to update the flat-file reference with the new name by running the command:

      vi NewName.vmdk



To create a new AppStack using this modified template VMDK, see the Creating an AppStack section in the VMware App Volumes User Guide.