Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i use a vm as a host machine? #1

Open
xinxinh2020 opened this issue Oct 11, 2019 · 10 comments
Open

Can i use a vm as a host machine? #1

xinxinh2020 opened this issue Oct 11, 2019 · 10 comments

Comments

@xinxinh2020
Copy link

xinxinh2020 commented Oct 11, 2019

Hi :
I run a vm created by Vmware WorkStation. For a taste of you benchmark,I compile
the code of hyperbench with uncommenting the 'CFLAGS += -D __BARE_METAL' and want to run it in the 'host machine' mode by considering the vm as a host. I wonder if it works?

@Second222None
Copy link
Collaborator

Second222None commented Oct 11, 2019

Hi,
It does work when treating QEMU/KVM's virtual machine as the host machine.
Although we didn't try it in VMware's virtual machine, I think it should work.
Imitate the tips in Section Compiling HyperBench and Section Start on host machine.

  1. Uncommenting the 'CFLAGS += -D __BARE_METAL' in the Makefile and type the command make.

  2. Copy the ELF file of HyperBench to /boot/ directory of your VM and then adding the following entry in the VM grub configuration file.

menuentry 'HyperBench'{
     insmod part_msdos
     insmod ext2
     set root='hd0,msdos1'
     multiboot /boot/hyperbench.64
}
  1. Reboot the VM and select the option HyperBench in the grub menu.

Good luck! Please feel free to contact me if you have any problems.

@xinxinh2020
Copy link
Author

Ok, Thanks for your clarification.
I make a mistake by using the GRUB instead of GRUB 2. Now my vm cannot seems to boot normally. I will try to use GRUB 2 later.

@Second222None
Copy link
Collaborator

Hi,
Maybe you should modify this statement set root='hd0,msdos1'. Keep it the same as other grub menus which can boot your VM correctly. Modifying grub is really a risky job. We have also encountered the same problem. Taking a snapshot is a viable solution.

@xinxinh2020
Copy link
Author

xinxinh2020 commented Oct 11, 2019

Strangely, I add the following entry in ubuntu 14.04's grub configuration file(/boot/grub/grub.cfg, there doesn't exist a /boot/grub2 directory) and it takes no effect.

menuentry 'HyperBench'{
     insmod part_msdos
     insmod ext2
     set root='hd0,msdos1'
     multiboot /boot/hyperbench.64
}

Then,I try to do this in a vm with centos7, and i find the entry added to /boot/grub2/grub.cfg shoud be :

menuentry 'HyperBench'{
     insmod part_msdos
     insmod ext2
     set root='hd0,msdos1'
     multiboot /hyperbench.64
}

Reboot it and select the HyperBench item, then i see some output like :
image
I think hyperbench is running correctly. However, it hands in this step for several minutes. Does it have not completed?

@Second222None
Copy link
Collaborator

Thanks for your feedback!
Originally, HyperBench is tested on Ubuntu-14.04-server and exactly there is no /boot/grub2 directory.
Grub version is examined by typing the command grub-install -V not by the directory name.
Look like so:
1

For your experiment in the VM with centos7, it may be the problem of x2APIC I guess (I am not sure whether the VMware supports this hardware feature in the VM and I will try to run HyperBench on VMware tomorrow and inform you the result.).
Try to comment the function enable_x2apic() in main.c (line 30 in the following picture) and recompile.
2

.

@xinxinh2020
Copy link
Author

My VM does have the cpu feature 'x2apic':
image

I follow your suggestion to comment the function enable_x2apic() in main.c , but it seems to take no effect. The output hangs in the same step as former.

@Second222None
Copy link
Collaborator

Second222None commented Oct 12, 2019

Hi,
It's my negligence. Sorry about that.
I have run HyperBench on a VMware virtual machine. The reason is that we set the number of physical cores. The default is 64 which is more than your configuration (8 CPUs I guess). The latest instructions (ReadMe) are available at the Start on host machine section.
I will show my results on VMware VM later.
Welcome to share your test results.

@xinxinh2020
Copy link
Author

Thanks for your patient reply.
I follow the latest instructions and the hyperhench succeeds to complete with the following result:
image
But i don't quite understand what the three columns of data in the picture above exactly mean.Hope for your clarification :)

@Second222None
Copy link
Collaborator

Second222None commented Oct 12, 2019

The last column is the run time (clock cycles) of the corresponding benchmark. The fourth and fifth columns are the data that is measured during the execution of HyperBench. The fifth column minus the fourth column is the final result (the last column). More details about the fourth and fifth columns are explained in our paper titled HyperBench: A Benchmark Suite for Virtualization Capabilities.

@xinxinh2020
Copy link
Author

Ok, i get it. I have read the paper before and have some conflusion about your work. Now things become much clearer. I will read the paper again in detail. Thanks for your helpful answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants