Welcome back to vSphere 8 in the real world. Now we're going to discuss virtual networking basics.
So some basic vocabulary when you're discussing virtual networking with vSphere.
So the virtual adapter, when you create a virtual machine, if you want to have the kind of network connectivity,
you're going to need to assign to it a virtual adapter. And that virtual adapter obviously will act like a physical machine's physical adapter to give that virtual machine connectivity to the networking.
You will have virtual switches and virtual switches work very much like what your physical switches would function like in your physical environment.
Virtual switches are used to gather the virtual NICs on your virtual machines together and, you know, to find policies and things like that.
Then those virtual switches are going to be connected to the host physical NICs, right?
So if your host has four physical NICs, then you might assign all four to your virtual switch or maybe you assign two to one virtual switch and you create another virtual switch that has two different ones.
And the reason why you'd separate them might be there's different types of traffic traveling over both of them, maybe ones like your iSCSI storage.
And so you want those NICs completely separated from your virtual machine. Or maybe you have different workloads and so you create different virtual switches for that.
You could also use the same host NICs and create different policies on them by creating what we're going to discuss in just a moment called a port group.
So a port group will allow you to create policies also for your NICs.
So you don't even need to create multiple different switches and assign different NICs if you want to actually use different physical NICs for different VM workloads and not just for different policies of the VM workloads.
So we'll discuss that more in just a little bit.
So here's kind of a basic architecture that might look like a kind of a concept.
You have your virtual machines. Your virtual machines have virtual adapters. The virtual adapters are going to connect to the virtual switch, okay?
Now, when you assign the virtual NIC to something, you actually don't assign it to a switch.
You're going to assign it to a port group, which we'll discuss here again in just a moment.
But what you'll show the representation of is the representation of it being connected to the virtual switch.
Then that virtual switch has a link to physical adapters on the physical host.
So virtual NICs connect to switches, and switches give you connectivity to the physical adapters on those hosts.
Here they're showing that the physical NICs on the host then are going to obviously connect to the physical switch in your environment.
So if you have multiple VLANs going from different port groups, for example, on a virtual switch,
and then going to the physical NIC on your host, and then going to your physical switch,
you would need to trunk the port going from the physical NIC on the host to the port on the switch.
That switch port would be trunked, and you would then allow the VLANs that the VMs are using.
So if your VMs are using VLANs 10 and 20, you would trunk 10 and 20.
If you also had a VM kernel port that was using VLAN 15, you'd have to trunk 10, 15, and 20,
all on the interface going from the NIC on the server to your switch, or from the NICs on your server to your switch.
So we also have what's called a port group, all right?
So on your virtual switch, you can assign things like a VLAN tag.
You can decide how the NICs that are attached to that switch are to be used.
Like if one's going to be your active adapter, and if your second one's going to be standby.
If they're both active, you can specify that.
If you have four on there, you can say these three are active, and this fourth one's standby,
or however you want to do that, you know, two and two.
You can configure all those things on the switch, the virtual switch.
Then when you create a port group, the port group can inherit those settings from the switch,
or it can override those settings, and you can set different settings
for like how the adapters are going to be utilized, or what causes a failover, you know,
from one adapter to another, and what happens when the adapter comes back online.
We'll discuss all those things more.
So the port groups are going to live within a virtual switch.
So when you assign a virtual machine to a virtual switch, you actually assign it to a port group,
and that port group is on a virtual switch.
And then on that port group, you'll have configurations like a VLAN tag.
You'll have configurations like which adapters are used, and what order the adapters are used in
for failover and for failback, and all that kind of stuff will be set on –
you can be set on the switch, and you can also then set something different
to be overridden by the port group.
Okay?
So connection methods, VLAN tags, and bandwidth.
So you can do traffic shaping and things like that on your port groups,
and the traffic shaping policies can be different than the policies on the virtual switches.
All right, so there are different types of switches.
There's a standard, which just basically means it only lives on that host.
There is a distributed, which means you've created it in vSphere on a data center,
and then you assign hosts to it.
And there's also an NSX distributed switch.
So if you have NSX in your environment, then you're using distributed virtual switches,
and those are basically the same type of switches that you would have with a distributed switch,
but only they're living in NSX, and there's a whole ton of security, you know, available.
NSX is a whole entire software-defined networking product that's very robust.
It's got tons of features, and it's way beyond the scope of just this one class.
So here they're showing we have a host.
The host has some VMs.
The network adapters on those two VMs happen to both be assigned to the same port group.
The port group is on a virtual switch.
The virtual switch then has the physical adapter on the host assigned to it,
and that physical adapter is connected to a virtual switch, right?
So it's kind of similar how you'd have in your environment where you'd have a physical server,
network adapter plugs into a physical switch, and then that switch has VLANs configured.
Only a port group is a lot more than just a VLAN tag.
It's also traffic shaping.
It's also security.
Like, are you going to allow MAC address, a forged transmiss, are you going to allow
promiscuous mode, things like that.
There's a bunch of different policies.
We'll get into all that in just a little bit.
So virtual switches are going to be local to a host.
They only exist on a host.
When you create a virtual switch, if you have five hosts, you have to create five virtual
switches on five different hosts at least.
Now, of course, when you install your host, you actually do get a virtual switch by default,
and you get the default port group called VM network, right?
So there is some default settings.
You actually could start functioning and not create anything, but most of the time in most
environments, you're going to want to do some configuration.
So the local host has the virtual switch on it, and you can configure, as we mentioned,
but not only things like load balance.
If we have multiple NICs, how is the load balance across those NICs?
Are two of them going to be in an active mode and one standby?
Is only one active and the rest are standby?
You can also set a physical adapter on a switch to be not used, right?
So what you could do is you could say we have three NICs on a virtual switch, and then I
create a port group and say NIC one is active, NIC two is standby, and NIC three is not used.
On my next port group, I might say two is active, three is standby, and one is not used
or something like that.
So you can, you know, kind of tap on different port groups, different adapters that are
available to use, some that are not used, certain ones are active, other ones are
standby, and they can be different for each one on the port group that's on that
virtual switch.
So here's kind of what it looks like inside of these on the ESXi host and vCenter.
So you can see you have on the right, you have your adapters and the adapters being
linked to the virtual switch.
That's the box in the middle.
And then on the left, you have the different port groups.
You have a management network port group, and that has your VM kernel port in it, and
then you have a VM network.
And on this example here, they're showing just two virtual machines on the VM network
port group, but there is no VLAN tag configured.
So distributed virtual switches, those are not created on a host-by-host basis.
Those are created in vSphere, right, in your vCenter server on a data center, and
then hosts are assigned to it.
So that allows me to create a distributed virtual switch, then I get to create port
groups on that distributed virtual switch and create policies for those different port
groups on those distributed virtual switches.
Then when I assign a host to that distributed virtual switch, and all I have to do is say
this distributed virtual switch has three uplinks, I'm going to say the three uplinks
on the distributed virtual switch need three NICs.
So when I assign the distributed virtual switch to the physical host, I'm going to say which
three NICs on that host are going to be connected to the distributed virtual switch.
Now the host has all the port groups on it, it has all the port group policies, and
everything's already done.
One of the nice things, besides not having to configure this over and over and over again,
is they're all named exactly the same, they're configured exactly the same.
I should expect very consistent performance and very consistent behaviors from my virtual
machine's traffic on the networks across all my hosts, because they all have the same exact
policies pulled from one source.
So for example, if I have a virtual machine connected to a port group, and that port group
was called accounting, and I want to vMotion that virtual machine from one host to another,
I want to have a port group named the exact same thing on the target machine it's going to.
Now with the newer versions of vSphere, I can't actually change the port group it's
attached to, I can give them one with a different name and things like that.
But if I don't want to worry about going and changing it and connecting to it, I just want
it to automatically be on the same network.
If I want DRS to automatically just put it on the right network, or HA to automatically
put it on the right network, then I want them named exactly the same across all my hosts.
And a distributed virtual switch gives me that.
In older versions, when they had to be named exactly the same, and we couldn't even choose
to change it during the vMotion, if accounting had a capital A on one host and a lowercase
A on another, it would say that port group doesn't exist.
It was case-sensitive, had to be named exactly the same, the spaces had to be exactly the
same if there's any spaces or anything like that, had to be identical.
So, a distributed virtual switch made that really, really simple because now I got the
exact same configuration across all my hosts.
So, that's why they say it's really good for large environments because I can configure
the virtual networking on 10 or 15 or 20 or, you know, a very large number of hosts just
by assigning them and saying, use these adapters.
On this host, use these adapters.
On host 2, use the adapters.
On host 3, use these adapters.
Then once I've done and assigned all that, everything else gets pushed out to it.
And it, again, has all the port groups and all the policies for the port groups, all
the VLAN taggings on there, all the configuration is done, and it's identical across them all.
So, here's some basic architecture of a virtual switch.
So, we have that virtual switch, and I can create multiple different port groups.
I can create, you know, a port group for accounting VMs.
I can create a port group for HR VMs.
I can then also create a VM kernel port, and that VM kernel port can have a different VLAN.
So, one port group has VLAN 10.
As I mentioned, another one has VLAN 20.
My VM kernel port has VLAN 15.
All those VLANs, when a machine sends traffic from one, you know, from itself to the switch,
the switch can say, oh, this is from this port group with, you know, VLAN 10, and the
traffic leaving the virtual switch going to the physical adapter is going to be on VLAN 10.
So, my physical switch has to be set to allow VLAN 10 on that interface, and if my other
machines from, you know, a different port group are VLAN 20, those packets, when they
reach the virtual switch, say, oh, this is from port group 2 over here, and that's VLAN
20, and it'll tag those packets with VLAN 20 going to that physical switch.
So, again, those interfaces would all need to be tagged on this example for VLAN 10,
VLAN 20, and 30 that shows on the slide here, or if my VM kernel port was 15, as I had
mentioned, VLAN 15.
So, that's a quick overview of virtual networking.
There's a lot more details to go into in the next lesson.
So, this is just some basic virtual networking concepts.
We discussed virtual adapters.
We discussed virtual switches.
We gave you a quick intro to distributed virtual switches, and we also discussed port groups.