find the cpu core in the host in which virtual machine is running - virtual-machine

I have openstack (kvm hypervisor) installed.
I have 32 cores in my host (/proc/stat...gives me that info)
I can start a vm from the host also I can get the cpu utilisation of the vm . I get this by finding the pid of the virtual machine from the host.
However I am not able to figure out is how do I know which virtual machine is running on which of the 32 core.
Is there any way to find it our
Or is there any way to explicitly pin it to a particular cpu?

This answer on ask.openstack.org https://ask.openstack.org/en/question/1282/can-openstack-choose-the-physical-resources-to-boot-a-vm/ indicates that "OpenStack Compute with the libvirt driver has no ability to pin a VM to specific physical CPU."

Related

How to enable VT-x inside a Virtual Machine inside a Virtual Machine

I have a windows 10 host operating system that supports virtualization. Next, I have an Ubuntu 16.04 virtual machine I created using virtualbox. For development purposes, I need to create a virtual machine inside my guest Ubuntu virtual machine. Unfortunately, I can't enable VT-x option in my guest Ubuntu machine to create a create a virtual machine inside my Ubuntu guest. Any information on how enable VT-x option on my virtual box inside my virtual Ubuntu machine would be appreciated.
Edit: I had that this may be accomplished through PCI Passthrough for VirtualBox. If so please detail how.
Lastly, my problem is similar to this guy's but with exception I can't seem to create an UBuntu32bit box.
Any information on how enable VT-x option on my virtual box inside my virtual Ubuntu machine would be appreciated.
You simply CAN'T.
VT-x is a hardware capability:
In 2006, both Intel (VT-x) and AMD (AMD-V) introduced limited hardware virtualization support that allowed simpler virtualization software but offered very few speed benefits. Greater hardware support, which allowed substantial speed improvements, came with later processor models.
Since VT-x requires hardware capabilities to work, there's no way for the "outer" virtual machine in your nested VMs to provide that capability to the "inner" VM. The "outer" VM doesn't have any actual hardware.
If you have to run a VM inside your VM that requires some of the capabilities that VT-x provides - such as the ability to run a 64-bit OS - you can try QEMU for the "inner" virtual machines. It'll be slower since it's an emulator and not true virtualization, though.

How to connect VM and Host for l2fwd?

I am working on l2fwd application with DPDK. I have taken an Ubuntu 16.04 as the Host system that initiates the packet generator and the Ubuntu 16.04 VM that initiates the l2fwd application to analyze the packets that are forwarded.
I have installed DPDK and Pktgen in the corresponding machines, but I am not sure how to establish a connection between Host and VM so that my host can transfer the packets to VM. Should I go with a Host only network? I wasn't able to find much references.
Please refer the DPDK l2fwd user guide, virtual function setup instructions.
Basically, the easiest way would be to either pass through your whole NIC to the VM or setup a virtual function (VF) on your NIC and pass through the configured virtual function.
Virtual function setup is different from driver to driver. For example, for ixgbe we pass arguments to kernel module, i.e.:
modprobe ixgbe max_vfs=2,2
The next steps are:
unbind kernel NIC driver from NIC/VF
bind the NIC/VF to vfio-pci driver
pass the device to the VM with argument -device vfio-pci,host=...
Please find more information here:
http://www.linux-kvm.org/page/10G_NIC_performance:_VFIO_vs_virtio

Openstack Compute node performance

Am starting to learn openstack. As per my understanding (after reading all the docs) is that the compute nodes run a host OS (ubuntu or other linux) and on top of that you have your hypervisor (like KVM) and then the VMs run on top of it i.e HW -> OS -> Hypervisor -> VMs . This is similar to having a VM running on Virtualbox which runs on a host operating system i.e HW-> Host OS ->VBox -> VMs.Please correct me if my understanding is incorrect.
Assuming my first understanding is correct, How will the performance of the VMs on the this architecture be compared to running the VMs directly on hypervisor i.e HW-> Hypervisor (KVM)->VMs ?
Comparing this with VMWare openstack architecture where Nova speaking to VMWare vCenter and then vCenter manages the ESXi nodes (vCenter and ESXi are on different nodes). This way my VMs are directly running on top of hypervisor connected to HW (HW->ESXi->VMs).And all the overlay networking is handled by NSX. This looks much more performant compared to the other architecture. Am i missing something here ?
Thanks in advance.
~exp8
Since kvm runs on linux kernel, and runs instructions directly on the cpu, it is the hypervisor (HW -> HyperVisor -> VM). On the VMware side, there is a tiny proprietary tuned version of linux as hypervisor.
To find out which one is more efficient, you should do benchmarking. But if you think Vmware's linux consumes less resources (less process, memory, cpu), it may be better.

Difference between virtual machine process and host os process?

Suppose in my pc I have Ubuntu as Host OS. Now I installed a Virtual Machine say VirtualBox (hypervisor) and then deployed a centos and a redhat os inside that as guest OS.
Suppose CentOS and redhat has 2 processes running and Ubuntu is running 3 processes. So following are my questions:
There are how many processes that Ubuntu is having?
Is there any difference between GuestOS and HostOS processes?
If all guestos runs as a process then they will get less time as compared to other process running on host os.
Please clear my doubts here.
Thank you.
Well let me clear your doubts,
First of all there aren't any specific number of process for an OS, its called as cores or threads, technically you can define how many cores or threads you want to use on your virtual machine and it depends on the system configuration you use.
Secondly Guest OS is what you have created in the virtual machine and host is what your laptop or pc actually run. Host OS uses the actual hardware for the working whereas the Guest OS uses the virtual hardware like number of cores and type and size of hard drive defined by the user while adding a virtual machine.
Third, as I mentioned earlier Guest and Host OS works on the configurations used by you, if you user higher amount of cores/ threads in setting your virtual machine the Guest OS will get higher speed.
Ideally the virtual machines are used to test and create some functionality of the Operating Systems without affecting the internal OS, so you can think of it as a your parents house where you can live and grow but at the end you cannot go away from the fact that their contribution is more and so you cannot go beyond their features without leaving it and making your own home.
Linux operating systems are multi-threaded operating system. The host OS would consider virtual box as a thread. You can define number of cores and virtual hard disk size for guest OS by using virtual box.
Since virtual box runs in separate thread and other operations of host OS runs in separate threads, there would be less effect on speed of processing. But I've observed big variances in processing speed in systems which have low memory. Each and every thread needs specific allocation of memory for its smooth operation. So systems having more than 2 GB RAM managed virtual box very well.

Which footprint can identify in Virtualization?

Think this example:
You are using Windows as a host machine and you are using ( virtualbox ) Linux for virtual machine. When you connect to the internet from virtual machine, someone try to track you. Now, can tracker find your host machine's footprint or just virtual machine's footprint? So, from the connection of virtual machine, the host machine can identifiable?
I try to search that but i can't find any result. Maybe i don't know the right words.
No, the host machine won't be identifiable