Cloudmin command to check resources allocated?

I want to be able to quickly check the current resource allocation and usage for any given guest system through Cloudmin command line. Unfortunately couldn't find any such command. The closest was

cloudmin list-usage --host guest.system

but it gives the history list like:

14/Aug/2014 07:45  14/Aug/2014 07:45  Yes  -          100%   8%     -        
14/Aug/2014 07:45  14/Aug/2014 08:40  Yes  1.50 GB    100%   17%    31.50 GB 
14/Aug/2014 08:40  14/Aug/2014 09:35  Yes  1.50 GB    100%   15%    31.50 GB 
14/Aug/2014 09:35  14/Aug/2014 10:30  Yes  1.50 GB    100%   8%     31.50 GB 
14/Aug/2014 10:30  14/Aug/2014 11:30  Yes  1.50 GB    100%   9%     31.50 GB 
14/Aug/2014 11:30  14/Aug/2014 12:30  Yes  1.50 GB    100%   12%    31.50 GB 
14/Aug/2014 12:30  14/Aug/2014 13:30  Yes  1.50 GB    100%   12%    31.50 GB 
14/Aug/2014 13:30  14/Aug/2014 14:25  Yes  1.50 GB    100%   2%     31.50 GB 
14/Aug/2014 14:25  14/Aug/2014 15:20  Yes  1.50 GB    100%   9%     31.50 GB 
14/Aug/2014 15:20  14/Aug/2014 16:15  Yes  1.50 GB    100%   5%     31.50 GB 
14/Aug/2014 16:15  14/Aug/2014 17:10  Yes  1.50 GB    100%   10%    31.50 GB 
14/Aug/2014 17:10  14/Aug/2014 18:05  Yes  1.50 GB    100%   5%     31.50 GB

from which we don't know number of CPU cores allocated and how much of memory and space has been used.

Is it possible to check the current status (resources allocated and used) of VPS from Cloudmin CLI?

Status: 
Active

Comments

Try the command cloudmin list-systems --host guest.system --multiline

Wow, that's really cool, everything we needed with one command. Thanks!

The "cloudmin list-systems --host guest.system --multiline" works perfectly well. Now in a custom script we are going to split the result data into parts and upload them to database tables. But then maybe Cloudmin already stores that data in some kind of database, then maybe we can avoid this splitting operation and can pull the data from directly Cloudmins database. Is it possible? What kind of database Cloudmin uses to store its data and where its tables are located?

Thanks again!

Cloudmin's "database" is really just a set of text files under /etc/webmin/servers with .serv extensions. The text file format is pretty self-evident - however, not all information shown by list-systems is in there, such as the live CPU and memory allocated to VMs.

you could call the remote API of list-systems and retrieve the data in json/xml format

That answers my question. Thanks, Jamie!

Hi Jamie,

If I open one of files with .serv extension in /etc/webmin/servers I can see the following lines regarding swap partition:

kvm_swapfile=/home/servers/host.domain.net.swap
kvm_swap=1536
kvm_drives=file=/home/servers/host.domain.net.img,media=disk,index=0,if=virtio,boot=on file=/home/servers/host.domain.net.swap,media=disk,index=1,cache=off,if=virtio

However firing "cloudmin list-systems --host host.domain.net --multiline" command doesn't list anything about swap. We can of course always get swap information from the file, but if it is possible could you please make possible for "cloudmin list-systems --host host.domain.net --multiline" command to also give this information or, even better, all the information that .serv file contains?

The list-systems command only outputs overview information. If you want to get a list of individual disks and their sizes, you can use the command cloudmin list-disks --host host.domain.net --multiline

Hi Jamie,

The list-systems command only outputs overview information. If you want to get a list of individual disks and their sizes, you can use the command cloudmin list-disks --host host.domain.net --multiline

That's really useful command, thank you for pointing it out to me. However, maybe I failed to explain myself. Let me try again.

If I try to run cloudmin list-systems --host host.domain.net --multiline | grep Disk it gives very nice output:

    Disk space used on host: 11.50 GB
    Disk limit over period: 740.09 GB hours (2860804164550656 byte seconds)
    Disk used over period: 740.09 GB hours (2860804164550656 byte seconds)
    Disk average over period: 10536837865 bytes
    Disk space: 9.84 GB
    Disk space free: 5.23 GB

I would like to get exactly the same information for swap partition and it is there in .serv file. While "cloudmin list-disks --host host.domain.net" gives lots of other useful information about disks, it doesn't give volume information of swap partition. My question is why not to make "cloudmin --miltiline" to ourput everything that .serv file contains? Why miss some of the information already containing there?

By the way, both "cloudmin" command with "--multiline" option and a file with ".serv" extension are missing one more parameter: Disk space used: = 4.61 in this example, the difference between "Disk space" and Disk space free". All three parameters are given for bandwidth and memory (total, used, free), so why not to give the same three for disks?

Another idea is not to come up with the new cloudmin command parameter, something like "cloudmin list-systems --host host.domain.net --resources-only" and provide everything and only about resources: Bandwidth, Disks and Memory. These are the most interesting parameters for all the users and would be great to find them easy ways. Thank you again for your attention!

Not all the information in the .serv file is up to date unfortunately - some of the sizes were only used at VM creation time. However, the list-disks command should include all swap disks if there are any still in use.

It is quite possible that if a swap disk was removed, it will be still in the .serv file, but not shown in list-disks because it is no longer used.

Well, list-disks give little bit different kind of information than on usage. Nevermind this as it is not so important as we can still derive that information form .serv file. We were just looking to the easiest way to collect on Usage of bandwidth, disks and memory.

Can you please elaborate, why not to make "cloudmin --multilne" command output "used" information as we have only "total"s and "free"s, like:

Disk space: 9.84 GB
Disk free: 5.23 GB

Real memory: 1.48 GB
Real memory free: 1.17 GB

Virtual memory: 1.50 GB
Virtual memory free: 1.50 GB

I understand that it is quite trivial just to subtract to get "used" information for all three parameters, but we would like to derive as much information from Cloudmin side as possible to avoid making calculations locally. If I understand correctly all the "used" information is already there somewhere between Cloudmin and KVM logs (or any other type of virtualization), it is not just given with "cloudmin --multiline" command.

Sure, I can add the disk/RAM used as part of that display easily. Look for it in the next release.

That'll give us another convenience. Thanks!