How to setup the VIP in Avi Vantage on a Linux Cloud - load-balancing

I've been trying to get Avi Vantage running on a single linux box using the docker installation method described here, using the "single host deployment" method:
http://kb.avinetworks.com/installing-avi-vantage-for-a-linux-server-cloud/
I've got the Controller and the Service Engine running and the Controller can see the Service Engine. Now, I'm trying to create a Virtual Service, but I'm not sure how to configure the Virtual IP (VIP).
What network interface should I bind the VIP to?

VIP is bound to interface based on the reachability. This is done automatically by placement manager.
case-1
Say eth0 - 1.1.1.2/24 and when vip is in the same subnet (say 1.1.1.100), vs placement logic will choose eth0.
case-2:
Say eth0 - 1.1.1.2/24 and when vip is in the different subnet (say 100.100.100.100), you can set the placement subnet in vs (advanced settings). That will force the vs to be placed on eth0
case-3:
The above can be done without placement subnet by using BGP. Configure BGP peers and enable_rhi in the VS (advanced_settings). VS will be placed on eth0 and additionally we will advertise vip though bgp. This will avoid manual configuration of routes to reach vip on the first hop router.

Related

Cross module direct communication (via IP / sockets)

If we have two custom modules that need to communicate directly via sockets, is there a way to know what the IP address assigned to each module?
After reading this article I was under the impression the azure-iot-edge network bridge would possibly support referencing the running module by the module name as the hostname. This doesn't seem to work.
I guess we are trying to avoid having to scan the network or use some local storage option and don't want to join the host network so any ideas how one module that is running can find the IP of another module that is expected to be running?
Here is a picture showing the two containers I am testing with. The one container is just an alpine instance that I can attach the console to and use to try to ping / access other containers. I can ping by IP address but want to ping by container name instead.
After further study of this issue, it turns out the issue was the arm32v7 arm image I was using when deployed had some issues. One of the oddities was that the date on the container was "Sun Jan 0 00:100:4174038 1900" and there were some other commands failing that should have worked.
I ended up switching over to an ubuntu image with iputils-ping installed and confirmed that the azuire-iot-edge bridge allows accessing other containers by their module name which servers as the host name, so all good here, works as expected, user error!

Create GCloud VM instance with no VPC

I need to create a Google Compute Engine Virtual Machine instance with no VPC.
For the App environment that I am using, I need to use the Public IP Address directly such as DigitalOcean Droplet, so if I run ifconfig command should show the interface with the public IP Address.
Each Compute Engine instance belongs to at least one VPC network. The use case you are describing is likely impossible given GCP's software-defined network architecture.
You can't create a VM in GCP without it belonging to some VPC. Console gui won't allow you that - you just have to have at least one interface.
But - there's a workaround;
ssh to your VM and create additional user & password; add this user to sudo group: (adduser username; echo 'sudouser:userspass' | chpasswd; usermod -aG google-sudoers sudouser)
logout
enable serial-console interactive aceess
login using serial console
disable all network interfaces
This way you will have a VM with only a serial console access - however I didn't try this myself.
There is a way to do it(not the vpc part because it's not possible but to see the external IP directly on vm). steps are below:
Launch a VM in VPC first, while launching, in networking section, set the IP-Forwarding on. --> do it while creating, once the vm is created, you can't do that.
Reserve a External IP in your project and vpc.
In the VPC routing, create a route and for destination network x.x.x.x/32 (reserved Public IP) --> point the next hop as the VM.
In VM, create a Sub interface and assign the public IP directly using ip addr.
Note: This works only if you're able to reach to VPC, example: VPN to access the VM over public IP.

Setting up ubuntu VM on Azure with apache

In Azure, I created a virtual network and then associated an Ubuntu Server virtual machine, created with Azure Resource Manager Deployment method, with the network. I then updated the associated Network Security Group and added an inbound security rule for port 80 (Source:Any, Destination:Any, Service:TCP/80). After installing Apache on the VM, I tried to access the server from my browser, but have run into a wall. I can SSH into the VM just fine, but web is a no-go, and I cannot figure out why. Any help would be appreciated.
It sometimes happen to me too because I forgot to RESTART the VM, yes just restart it. At least this works for me. and also dont forget to add outbound rule too
It worked for me with this inbound rule.
Note that when a VM is created from the portal (in ARM model), it gets automatically associated to a virtual network (vnet), a specific subnet within the vnet and a network security group.
When creating the inbound security rule, make sure to:
identify the correct network security group associated to the VM
use a priority number lower than 65500
set the source port range as *
You also need open port 80 on the VM to allow web access.
I dont think that creating your Network Security Group opens the desired port on the VM automatically.
By default in Azure Resource Manager (ARM), all ports are open; there is no need to make Network Security Groups (NSGs) to open ports, only to close them. Here is an example of an ARM template that deploys an ubuntu VM with apache:
https://github.com/Azure/azure-quickstart-templates/tree/master/apache2-on-ubuntu-vm
Alternatively, if you want an auto-scaling LAP stack using VM Scale Sets (in public preview), you can find the ARM template for that here:
https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-lapstack-autoscale
Hope this helps! :)

KVM VM dhcp while configured a static IP in XML

I'm trying to workaround a DHCP issue by configuring my guest VM to use DHCP (to avoid having to configure it manually with a static IP) but defining a static IP in the XML.
This would enable setting an IP upon creation while not requiring configuring the virtual machines operating system to a static IP (making it sort of "independent").
I should point out:
Guests are Windows/Linux mixed
Must use a bridge setup (not NAT)
Is this a reasonable solution? any recommendations to the actual XML markup of the guest?
When saying static ip configuration instead of DHCP, it's not a libvirt thing but a configuration of guest OS. refer to this maillist for example.
So you can make it via a custom DHCP server that listens on your bridge network instead of default NAT. it only assigns specific ips to specific mac addresses. It's very easy to make it via dnsmasq.
If you do want to exclude any DHCP broadcast in your bridge network, think about bootstrap processes inside your guest OS. The config drive is a good choice where it allows you creating a disk file and attach to the VM, then the cloud-init daemon on guest OS will pick it up to replace network configuration. But it's just too many if you just want static ips.

VLAN configuration using openvswitch

I am working on a project where we create multiple vms on a host machine. There are multiple hosts of this kind. These hosts are connected to a single LAN and the VMs are created using KVM. Qemu and libvirt are used alongwith. There is a requirement where I need to create multiple VLANs such that some VMs on a host can be a part of one VLAN and the rest could be a part of another VLAN. These VLANs are also spread across multiple hosts.
I was trying to achieve this using openvswitch but failed to succeed. I have followed many solutions available online but I am left in a confused state. Please help me.
I am not clear if openvswitch creates the VLANs or we need to create the VLANs at our end and openvswitch just helps in configuring those with the VMS?
If openvswitch creates the VLANs then what is the way to go?All the configuration that I have tried gives me an error or does not behave as expected. Please point me to the right direction.
Read the section Setting VLAN tag from libvirt.org.
According to OpenVSwitch network type, you can directly specify VLAN tags via element <vlan> to a port from an OpenVSwitch bridge, and libvirt will manage the VLAN tags for your VM network.
Steps:
configure OpenVSwitch bridge for your virtual machine by following the guide How to Use Open vSwitch with Libvirt
add a new element <vlan> to your virtual machine network by specifying vlan id.