Jump to content
Welcome to our new Citrix community!
  • 1

Xenserver: How to see local storage disk space used on command line?


andhika satria

Question

I'm running a XenServer 6 and 7 systems, hosting Windows and Linux VMs. So I used Nagios Core for monitoring system.

All of the hypervisors use local storage, typically one or more disk.

The problem: I'm currently building monitoring systems, using Nagios Core. One of the most important things is to monitor disk usage on the storage repositories, and this can be done simply from the command line using df. However Xen doesn't give direct access to the storage repository disk space. I'm aware of the advice here - https://linuxconfig.org/how-to-check-used-local-storage-repository-disk-space-on-xenserver-linux - however on my XenServers the only disks that show up under /run/sr-mount are the NFS-mounted backup disks.

The question:
-How can I get disk usage stats on the command line (such as df usually gives) for a local disk storage repository, under XenServer 6, and also under XenServer 7?
-or, How to show local disk storage, usage storage, size storage, as in the picture I attach with command in XenServer 6 & XenServer 7 ?

Link to comment

6 answers to this question

Recommended Posts

  • 0

I have try xe sr-list and got the UUID. After that I try df -h /run/sr-mount/UUID-of-SR and it can display information about the storage, but this is works in ext3 filesystem and ISO, not in lvm. If i try in lvm system there is no UUID-of-SR for lvm, only exist for the ext3 & ISO. (Image Attached)

 

My question, where is the location of LVM UUID-of-SR ? and how to display information about Local Storage Xenserver with LVM filesystem especially using df -h ?

 

thanks for the respon.

Image1.jpg

Image2.jpg

Link to comment
  • 0

hi,

 

i have tried pvscan and i got the result too.. but if i try df -h with /dev/sda3, /dev/sdb, /dev/sdc, or /dev/sdd the result always devtmps .. and i try too with /dev/VG_XenStorage but the result still same. Is there another path used? because this is for monitoring storage purpose and how to work/run is the same as df command. I want to make it displayed as the image i attached in the red box using df command

image1.png

Link to comment
  • 0

Since this thread still appears in Google searches about getting the SR usage in command line, I'll update just add this:

 

There's more fields in "xe sr-list" than just what you see with no parameters. If you append "params=all", it'll have a lot more, in addition virtual-allocation, physical-utilisation and physical-size.

 

Example of that:

 

# xe sr-list params=all

uuid ( RO)                    : 123456789-1234-1234-1234-1234567890
              name-label ( RW): Local ISO
        name-description ( RW): 
                    host ( RO): demohost1
      allowed-operations (SRO): unplug; plug; PBD.create; PBD.destroy; VDI.clone; scan; VDI.create; VDI.destroy
      current-operations (SRO): 
                    VDIs (SRO): 123456789-1234-1234-1234-1234567890; 123456789-1234-1234-1234-1234567890
                    PBDs (SRO): 123456789-1234-1234-1234-1234567890
      virtual-allocation ( RO): 1082130432
    physical-utilisation ( RO): 2886258688
           physical-size ( RO): 18889830400
                    type ( RO): iso
            content-type ( RO): iso
                  shared ( RW): false
           introduced-by ( RO): <not in database>
             is-tools-sr ( RO): false
            other-config (MRW): 
               sm-config (MRO): 
                   blobs ( RO): 
     local-cache-enabled ( RO): false
                    tags (SRW): 
               clustered ( RO): false

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...