On both Guest machine and host machine, I am using Ubuntu 12.04. As a hypervisor I am using KVM. I want to perform some experiments related to boot-storm and I have created all other scripts to create VM, delete VM and start VM. But I don't know how to measure boot time for each VM.
Though not necessary but it will be good if the boot time has one to one mapping to VM in some sense, by name or by mac address etc.
Boot time: I want to do ssh from host and when its successful I will consider that the VM has been booted up successfully.
The solution should be scalable as I want to perform experiment for 100-150 VMs.
Problems:
1) How to get the IP address of a guest VM from Host machine ?
2) Mapping of Domainname-> IP
3) Mapping of IP -> Boot time
Best Answer
Here is an example how you can test if a machine is online using
ping
:You can adapt this to use
ssh
by replacing theping
line with something likessh $1 "echo"
, assuming you can connect to the machine without a password.Using the above script (let's call it
test-online.sh
), you can start the machine and then measure the time usingGNU time
(the first argument of this script is the machine name):The output will be something like
1:23.52
which means your machine took 1 minute 23 seconds to boot.If you want to measure the boot time of many machines, you can just call
start-and-time.sh
for every machine:which will give the following exemplary output: