Article ID: 118622, created on Nov 13, 2013, last review on Jun 17, 2016

  • Applies to:
  • Virtuozzo

Symptoms

Sometimes /vz partition is not placed on the fastest available hard drive in the system, but pfcache is created on /vz by default. To optimize the IO performance of the containers, it is advised to move pfcache to the fastest disk available.

This scenario is quite frequent on Parallels Cloud Storage infrastructure, when /vz partition does not store any virtual environments.

Also, if there's an SSD drive attached, it is advised to use it for pfcache relocation.

Resolution

This example demonstrates how to move pfcache from /vz to /pstorage partition.

  1. Stop pfcache service:

    ~# service pfcached stop
    
  2. Remount all ploop devices without pfcache option:

    ~# grep pfcache= /proc/mounts
    /dev/ploop57184p1 /vz/root/103 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
    /dev/ploop24447p1 /vz/root/104 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
    
    ~# awk '/pfcache=/{print $1" "$2}' /proc/mounts | while read ploop mpoint ; do mount -n -t ext4 -o remount,nopfcache $ploop $mpoint ; done
    
    ~# grep pfcache= /proc/mounts
      ...there should be no output here...
    
  3. Unmount pfcache ploop:

    ~# ploop umount /vz/pfcache.hdd/DiskDescriptor.xml
    
  4. Move the pfcache hdd to /pstorage partition:

    ~# mv /vz/pfcache.hdd /pstorage
    
  5. Correct global configuration file to reflect this change:

    ~# sed '/^PFCACHE_IMAGE=/ s~.*~PFCACHE_IMAGE="/pstorage/pfcache.hdd"~' -i /etc/sysconfig/vz
    
  6. Mount pfcache from the new location:

    ~# ploop mount -m /vz/pfcache /pstorage/pfcache.hdd/DiskDescriptor.xml
    
  7. Remount all ploop devices with pfcache:

    ~# grep ploop /proc/mounts | grep -v ' /vz/pfcache '
    /dev/ploop57184p1 /vz/root/103 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum 0 0
    /dev/ploop24447p1 /vz/root/104 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum 0 0
    
    ~# awk '/^\/dev\/ploop/&&!/ \/vz\/pfcache /{print $1" "$2}' /proc/mounts | while read ploop mpoint ; do mount -t ext4 -o remount,pfcache=/vz/pfcache $ploop $mpoint ; done
    
    ~# grep pfcache= /proc/mounts
    /dev/ploop57184p1 /vz/root/103 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
    /dev/ploop24447p1 /vz/root/104 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
    

    (Note: if the mount pount for pfcache was changed from the default value /vz/pfcache, use the appropriate value in the commands in the steps 6 and 7.)

  8. Start pfcache service:

    ~# service pfcached start
    

Additional information

SSD disks have limited resource for cells reprogramming, it is necessary to check disk's health periodically.

Search Words

pfcache

move

error 255 due creating container

location

2897d76d56d2010f4e3a28f864d69223 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF