[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] failed to mount cgroup



Exactly, the mount point could also be /cgroup. The difference is the mount type.

Scenario 1 could work with both libvirt-0.10.x and higher version.
Scenario 2 could work with libvirt-0.10.x but failed with higher version.

What's limitation with 'mount -t cgroup cgroup /cgroup'?

1.
# mount -t tmpfs cgroup /cgroup
# mkdir /cgroup/{freezer,devices,memory,cpuacct,cpuset}
# mount -t cgroup -ofreezer cgroup /cgroup/freezer
# mount -t cgroup -odevices cgroup /cgroup/devices
# mount -t cgroup -omemory cgroup /cgroup/memory
# mount -t cgroup -ocpuacct cgroup /cgroup/cpuacct
# mount -t cgroup -ocpuset cgroup /cgroup/cpuset

# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext2 rw,relatime 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /var/volatile tmpfs rw,relatime 0 0
tmpfs /media/ram tmpfs rw,relatime 0 0
cgroup /cgroup tmpfs rw,relatime 0 0
cgroup /cgroup/freezer cgroup rw,relatime,freezer 0 0
cgroup /cgroup/devices cgroup rw,relatime,devices 0 0
cgroup /cgroup/memory cgroup rw,relatime,memory 0 0
cgroup /cgroup/cpuacct cgroup rw,relatime,cpuacct 0 0
cgroup /cgroup/cpuset cgroup rw,relatime,cpuset 0 0

# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /var/volatile type tmpfs (rw,relatime)
tmpfs on /media/ram type tmpfs (rw,relatime)
cgroup on /cgroup type tmpfs (rw,relatime)
cgroup on /cgroup/freezer type cgroup (rw,relatime,freezer)
cgroup on /cgroup/devices type cgroup (rw,relatime,devices)
cgroup on /cgroup/memory type cgroup (rw,relatime,memory)
cgroup on /cgroup/cpuacct type cgroup (rw,relatime,cpuacct)
cgroup on /cgroup/cpuset type cgroup (rw,relatime,cpuset)

# cat /proc/cgroups
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  6       1       1
cpuacct 5       1       1
memory  4       1       1
devices 3       1       1
freezer 2       1       1


2. 
# mkdir /cgroup
# mount -t cgroup cgroup /cgroup

# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext2 rw,relatime 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /var/volatile tmpfs rw,relatime 0 0
tmpfs /media/ram tmpfs rw,relatime 0 0
cgroup /cgroup cgroup rw,relatime,freezer,devices,memory,cpuacct,cpuset 0 0

# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /var/volatile type tmpfs (rw,relatime)
tmpfs on /media/ram type tmpfs (rw,relatime)
cgroup on /cgroup type cgroup (rw,relatime,freezer,devices,memory,cpuacct,cpuset)

# cat /proc/cgroups
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  1       1       1
cpuacct 1       1       1
memory  1       1       1
devices 1       1       1
freezer 1       1       1

Best Regards,
Olivia

> -----Original Message-----
> From: Gao feng [mailto:gaofeng cn fujitsu com]
> Sent: Thursday, March 07, 2013 4:58 PM
> To: Yin Olivia-R63875
> Cc: libvir-list redhat com
> Subject: Re: [libvirt] failed to mount cgroup
> 
> On 2013/03/07 16:45, Yin Olivia-R63875 wrote:
> > cgroup on /sys/fs/cgroup type cgroup
> (rw,relatime,freezer,devices,memory,cpuacct,cpuset)
> 
> If you prefer to mount these subsystems together.
> you should try below steps:
> 
> mkdir /sys/fs/cgroup/freezer,devices,memory,cpuacct,cpuset
> 
> mount -t cgroup -ofreezer,devices,memory,cpuacct,cpuset cgroup
> /sys/fs/cgroup/freezer,devices,memory,cpuacct,cpuset
> 
> Key is the name of mount point should equal to the cgroup subsystems.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]