How to connect multiple virtual machines hosted on the physical machine using kvm? - virtualization

I have been given a scenario in which multiple virtual machines are hosted by a same single physical machine. KVM is the hypervisor used for managing these virtual machines. How do I connect all the virtual machines to each other?

libvirt NAT and Bridged
libvirt supports openvSwitch as well

Related

Communicating with the system under different subnet within a LAN using TCP

I have made two programs using socket programming (TCP), one is for the server and the other is for the client.
They are run on two different machines, and I am successful in communicating between them when they are on the same subnet, but I'm unable to communicate when they are on two different subnets. The machines are on the same LAN in both cases.
What is the solution for communicating between machines on two different subnets?
We have tried to change the subnet address of one of the machines to match with the other, which didn't work. We also tried adding an additional IP address, but are stuck in between.

System hangs after running master cluster kubernetes

Whenever I try to run the Kubernetes cluster from the master’s machine using the below command, my system hangs and gets very slow and I even cant open explorer, or firefox. I have two VM with network configuration NAT and Host-only adapter.
kubeadm init --apiserver-advertise-address=<ip-address-of-kmaster-vm> --pod-network-cidr=192.168.0.0/16
Any help is highly appreciated
As was discussed in comments, the root cause of the issue was not enough resources available in this VirtualMachine.
In Kubeadm documentation, minimal requirements are:
To follow this guide, you need:
One or more machines running a deb/rpm-compatible Linux OS; for example: Ubuntu or CentOS.
2 GiB or more of RAM per machine--any less leaves little room for your apps.
At least 2 CPUs on the machine that you use as a control-plane node.
Full network connectivity among all machines in the cluster. You can use either a public or a private network.
OP's VM had set RAM to 2GB which casued performance issue using different applications.
When RAM on the VM was set to 4GB, Virtual Machine is working perfectly fine.

Kubernetes in Vsphere Virtual machines

Dears,
Sorry may be a basic question for some of you. If i have a Vsphere Environment and i am allowed to access only 2 Virtual machines inside them. Can I set kubernetes cluster with 1 VM as master and 1 VM as Minion without interacting with the hypervisor or the Vsphere center ?
In this case what are the requirements
I already set up an environment in my Laptop but i should define a host only network in Virtualbox and define the machines also for the host ? should that be the same in case of Vsphere ?
There are some requirements for Kubernetes cluster. According to the official documentation it is necessary to have:
One or more machines running one of:
Ubuntu 16.04+
Debian 9
CentOS 7
RHEL 7
Fedora 25/26 (best-effort)
HypriotOS v1.0.1+
Container Linux (tested with 1800.6.0)
2 GB or more of RAM per machine (any less will leave little room for your apps)
2 CPUs or more
Full network connectivity between all machines in the cluster (public or private network is fine)
Unique hostname, MAC address, and product_uuid for every node. See here for more details.
Certain ports are open on your machines. See here for more details.
Swap disabled. You MUST disable swap in order for the kubelet to work properly.
Also, IP subnets for Services and for Pods must not interfere with IP subnets in the same VPC.
To set up Kubernetes cluster it is enough to have SSH access to VMs. Additional network interfaces are not required.
If you already have VMs, the most convenient tool for cluster creation is kubeadm. Please, consider reading the following part of official documentation:
Creating a single master cluster with kubeadm

Can I setup kubernetes cluster using kubeadm on ubuntu machines inside a office LAN

I was looking at this url.
It says-"If you already have a way to configure hosting resources, use kubeadm to easily bring up a cluster with a single command per machine."
What do you mean by "If you already have a way to configure hosting resources"?
If I have a few Ubuntu machines within my office LAN can I setup Kubernetes cluster on them using kubeadm?
It just means that you already have a way of installing an OS on these machines, booting them, assigning IPs on your LAN and so. If you can SSH into your nodes to be you are ready!
Follow the guide carefully and you will have a demo cluster in no time.

How about the docker run in virtul machine best practice?

How about the docker run in virtul machine best practice?
PS:
anybody has the docker run in kvm virtul machine on the production?
or run in AWS and other cloud platform?
for example,I building the mongodb in docker container and deploy it on the production envirment apply to provider data for a PV 100,000,000/day SNS community .
what about the performance ?
it's no recommend to use docker in virtual machine?
Docker is a process isolated with namespace and cgroup. It is a Operating system level virtualization and haven't any association with virtual machine. You can use with virtual hardware or bare metal without difference.