«

»

Aug 23 2016

Generate random data in Linux based VM

“VMTurbo"
A few weeks back i was asked by a customer to create a lot of random data in same amount of Linux (CentOS) based VMs as there were Nutanix nodes in their cluster.

I can see multiple reasons for doing this but that is a complete separate discussion, i just wanted to share the bash script i used in each VM after creating a 1 TB disk in each VM. There was some basic requirements such as:

  • Logging start and complete time in the SSH session and to log file.
  • Able to easily change
    • file size
    • number of files to be created
    • file name
    • /datatest – directory specification

Below is the scrip, creating 1000 1GB files,  i was using to generate some data.

 

This is SSH session output when i ran the script in my test environment today, only creating 4 files.

Screen Shot 2016-08-23 at 22.34.37

Another blog post with the same kind of topic is “Duplicate random generated data in Linux based VM” which is similar to this one but does not only generate random data. It will however, complete way faster and your file system will have a ton of data if you want.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">