M
M
mureevms2017-01-26 13:31:19
linux
mureevms, 2017-01-26 13:31:19

Why is the size of the virtual disk growing on Hyper-V?

I recently encountered such a situation. There is Hyper-V, on it is a guest Ubuntu, on it is a LAMP stack. Whoever posted a new entry on the site inadvertently allowed anonymous commenting on this entry. And away we go. But I discovered this later. Mysql eats up all memory. I can’t log into the system even from the hypervisor console, because the brakes. The login attempt is timed out. Began to sin on the file system.
On a new virtual machine with Ubuntu, I deployed a site from a backup, in which the same hole, . The disk type on the guest is dynamic . The disk file on Hyper-V began to expand and reached almost full size in about an hour, which is 30 gigs. At what,df -hin the guest said that less than 20% is occupied. FS is now excluded. Swap, in theory, also has nothing to do with it, because. limited to its size of 500 MB. Theoretically, it is possible to populate the /tmp directory, but Ubuntu did not reboot and Mysql does not write there. In addition, the dump size is ~300 MB. Old dumps (before the hole) weigh about 80.
As I discovered and closed the hole, the growth of the disk stopped. At the moment, on Hyper-V, the disk file weighs 30 gigs, and Ubuntu takes about only 10. I checked with du, df, counted in mc.
The hole was exploited by simple POST requests to add text comments. At the time of discovery, there were ~125 thousand records in the database.
Although the problem has been solved, I still want to know the reasons for this case.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem @Jump, 2017-01-26
Tag

The disk is dynamic so it automatically increases in size when it is written to.
That is, the guest OS has written enough data to increase the size.
What other reasons could there be? This is the normal behavior of the system.

R
Roman Mirilaczvili, 2017-01-26
@2ord

Mysql writes data to the folder /var/lib/mysql, jumping up the size of the database container (file ibdata1) to a suitable size .
I believe that due to the use of a dynamic disk type, Hyper-V increases it by some size when the disk container limit is reached, depending on the growth rate.
So I agree with Artem about the regular behavior (hypervisor).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question