Search This Blog

Tuesday, June 24, 2025

 SCVMM Logical Switch Setup – Single and Dual NICs with Monitoring Capabilities


Step-by-Step: Creating a Logical Switch in SCVMM


1. Define Native Resources (Once Per Environment)

a. Create Virtual Network Adapters Port Profiles

Each vNIC (e.g., Management, VM, Live Migration) needs a Port Profile:

Fabric > Networking > Port Profiles > Virtual Network Adapter

  • Example Port Profiles:
    • Management – Medium weight (20%)
    • VM Network – High weight (40%)
    • Backup – Medium (20%)
    • vMotion – Low (10%)

Each profile includes:

  • Bandwidth settings (Minimum Bandwidth Weight)
  • QoS mode (Weight, Absolute, None)
  • Security settings (MAC spoofing, DHCP Guard, etc.)

b. Create Port Classifications

These are labels used to apply the profiles later on.

Fabric > Networking > Port Classifications

  • Create one per profile (e.g., "Management", "VM", "vMotion", "Backup")

Then map the Port Classification to the Port Profile.


2. Create Uplink Port Profile

Controls NIC teaming, Load balancing, VLAN trunking, and uplink mapping.

Fabric > Networking > Uplink Port Profiles

Set:

  • NIC Teaming mode: Static, LACP, or Switch Independent
  • Load balancing mode: Dynamic recommended
  • VLANs allowed: Trunk mode (specify allowed VLANs)

3. Create Logical Switch

Fabric > Networking > Logical Switches > Create Logical Switch

Configure:

  • Extensions (e.g., Microsoft NDIS)
  • Uplink Port Profile (created in previous step)
  • Associate Port Classifications
  • Enable Host Teaming (for 2 uplinks scenario)


 

Bandwidth Prioritization by Traffic Type

Use Minimum Bandwidth Weight in Port Profiles (QoS):

Traffic Type

Weight (%)

Notes

VM Traffic

40%

Default / dynamic traffic

Management

20%

Ensure host access remains

Backup

20%

Important but not time-critical

vMotion

10%

Only during migration events

  • These weights control how bandwidth is shared when contention occurs.
  • You can also define absolute minimums in newer SCVMM versions.

 

Traffic Separation Across 2 Uplinks (Active/Standby & Pinning)

SCVMM supports this using Network Sites + Logical Networks:

a. Define Logical Networks

Create multiple logical networks, one for each type of traffic (Mgmt, VM, vMotion, etc.), each with a unique VLAN.

b. Define Network Sites

In each Logical Network, create Network Sites that:

  • Specify uplink assignment
  • Pin VLANs/logical networks to specific uplinks (via host group)

c. Active/Standby Uplink Mapping

When defining the Uplink Port Profile, you can:

  • Assign specific uplinks to a VLAN or logical network
  • Use "Preferred" vs "Standby" NICs per traffic type

SCVMM doesn’t offer full traffic pinning in all teaming modes (e.g., in Switch Independent teaming, actual pinning depends on host-side NIC configuration).


Example: Uplink Behavior

Traffic

VLAN

Uplink 1

Uplink 2

Management

10

Active

Standby

vMotion

20

Standby

Active

VM Traffic

30

Active

Active

Backup

40

Active

Active

This logic is implemented by:

  • Network Sites per host group
  • Uplink Port Profile VLAN mapping
  • Port Profile + Classification on each vNIC

Summary

Task

Supported in SCVMM

Key Feature / Step

Create logical switch

Port Profiles + Uplink Port Profile

Prioritize network bandwidth

Minimum Bandwidth Weight (QoS)

Assign traffic to uplinks

✅ (with control)

Network Sites + Uplink Mapping

Pin workloads to NICs (e.g., Mgmt on NIC1)

✅ (via VLAN mapping)

Logical Network ↔ Uplink associations

 

 


 

Steps to Configure VLANs on a Logical Switch in SCVMM

1. Prerequisites

  • Physical switch ports are trunked (allowing tagged VLANs).
  • Hyper-V hosts are already added to SCVMM.
  • Uplink port profiles and port classifications are planned.

2. Create Uplink Port Profile

  1. Go to Fabric > Logical Networks > Uplink Port Profiles
  2. Click Create Uplink Port Profile
  3. Assign a name (e.g., Trunk_Uplink)
  4. Choose "Team" if you’ll use NIC teaming.
  5. Under Networks, select the Logical Networks and associated VLANs (e.g., VLAN 10 for MGMT, 20 for VM, etc.)
  6. Save

3. Create Logical Switch

  1. Go to Fabric > Logical Switches > Create Logical Switch
  2. Name it (e.g., Prod-Switch)
  3. Choose:
    • Enable Uplink Mode = Team
    • Assign the Uplink Port Profile created earlier
  4. Add Port Classifications (e.g., High Bandwidth, Standard, etc.)
  5. Add the Virtual Port Profiles that map to those classifications

4. Create Logical Networks with VLANs

If not already done:

  1. Go to Fabric > Networking > Logical Networks > Create Logical Network
  2. Choose One Connected Network
  3. Define Network Site(s) for host groups
  4. Specify VLANs:
    • VLAN 10 – Management
    • VLAN 20 – VM traffic
    • VLAN 30 – Backup
    • etc.
  5. Enable "Allow host access" if the host OS should use that network

5. Apply Logical Switch to Host

  1. Go to Fabric > Hosts > Host > Properties
  2. Under Virtual Switches, click New Virtual Switch
  3. Select your Logical Switch
  4. Choose adapters and map VLANs via the correct port classifications

Optional: Use PowerShell

 

Example powershell:

 

# Example: Create a logical network site with VLAN

$ln = Get-SCLogicalNetwork -Name "ProdNetwork"

New-SCLogicalNetworkDefinition -Name "Prod-VLAN20" -LogicalNetwork $ln -VLANID 20 -Subnet "192.168.20.0/24" -NetworkSite $site


Best Practices

Best Practice

Recommendation

Tag VLANs on SCVMM

Let SCVMM handle tagging—switchports stay trunked

Use consistent classification names

Helps templates and automation

Document VLAN-to-traffic mapping

Avoid misrouting and troubleshooting issues

Validate NIC Teaming/LLDP

Especially on converged networks

 


 

Monitoring Networking Traffic with SCVMM

Monitoring network traffic in SCVMM (System Center Virtual Machine Manager) helps you analyze bandwidth usage per VM, virtual NIC, or virtual switch—useful for troubleshooting, capacity planning, and ensuring SLAs.

Here’s how to monitor network traffic in SCVMM:


1. SCVMM Console (Basic Monitoring)

Steps:

  1. Open SCVMM Console.
  2. Go to VMs and Services.
  3. Select a VM or Host.
  4. In the bottom pane, go to the Performance tab.
  5. If integrated with SCOM, you will see:
    • Network In (Bytes/sec)
    • Network Out (Bytes/sec)
    • Total Throughput
    • Historical charts

SCOM (Operations Manager) is required for detailed network monitoring and history.


2. SCVMM + SCOM Integration (Recommended for Full Metrics)

With SCVMM-SCOM integration, you get:

  • VM NIC throughput (in/out)
  • Hyper-V virtual switch monitoring
  • Network usage trends over time
  • Alerts and thresholds (e.g., high throughput)
  • Custom dashboards and reports

To set this up:

  1. Import SCVMM management pack into SCOM.
  2. Link SCVMM to SCOM (via SCVMM Settings > System Center Settings > Operations Manager Server).
  3. Enable performance data collection rules.

3. PowerShell (Local on Hyper-V Host)

If you want live network stats without SCOM:

Get per-VM NIC traffic:

Get-VMNetworkAdapter -VMName "VM01" | Get-VMNetworkAdapterStatistics

Output includes:

  • BytesReceived
  • BytesSent
  • PacketsDropped

You can loop this over all VMs for bulk reporting.


4. Performance Monitor (PerfMon) on Hyper-V Host

Counters to Use:

  • Hyper-V Virtual Network Adapter(*)\Bytes/sec
  • Hyper-V Virtual Switch(*)\Bytes/sec

These can help track VM network traffic live and over time.


5. Windows Admin Center (WAC)

Another modern way to monitor VM network usage if SCVMM isn't connected to SCOM:

  • Go to WAC > Virtual Machines > Select VM
  • Navigate to Performance tab
  • View Network I/O over time


 

Summary Table

Method

Requires SCOM

Granularity

Notes

SCVMM Console

Optional

Low (real-time)

Enhanced with SCOM

SCVMM + SCOM

✅ Yes

High (historical)

Alerts, reports, per VM/VNIC

PowerShell (Host)

❌ No

Real-time

Simple and scriptable

PerfMon (Host)

❌ No

Real-time + logs

Use for long-term local logging

Windows Admin Center

❌ No

Medium

Nice UI, host-centric

 


 

PowerShell Scripts for Monitoring

PowerShell script to monitor network traffic (Bytes Sent / Bytes Received) for all VMs running on a Hyper-V host or across multiple hosts managed by SCVMM. I'll give you two versions:


Option 1: Run Directly on Hyper-V Host (No SCVMM / No SCOM)

This gives real-time stats per VM NIC:

# Get all running VMs on the local Hyper-V host
$vms = Get-VM | Where-Object { $_.State -eq 'Running' }
 
foreach ($vm in $vms) {
    $nics = Get-VMNetworkAdapter -VMName $vm.Name
    foreach ($nic in $nics) {
        $stats = Get-VMNetworkAdapterStatistics -VMNetworkAdapter $nic
        [PSCustomObject]@{
            VMName        = $vm.Name
            AdapterName   = $nic.Name
            BytesSent     = $stats.BytesSent
            BytesReceived = $stats.BytesReceived
        }
    }
}

You can schedule this or run it periodically to get current stats. The counters reset when the VM reboots.


Option 2: Run from SCVMM Server (For All VMs)

This version works in SCVMM PowerShell and queries all VMs managed by SCVMM, but it can’t get live byte counts without SCOM. However, it can get virtual NIC config and IP info.

# Load SCVMM module
Import-Module VirtualMachineManager
 
# Connect to SCVMM (skip if already connected)
# Get-SCVMMServer -ComputerName "SCVMM01"
 
# Get all VMs and their network adapters
$vms = Get-SCVirtualMachine | Where-Object { $_.Status -eq "Running" }
 
foreach ($vm in $vms) {
    $nics = Get-SCVirtualNetworkAdapter -VM $vm
    foreach ($nic in $nics) {
        [PSCustomObject]@{
            VMName       = $vm.Name
            NICName      = $nic.Name
            MACAddress   = $nic.MACAddress
            IPAddress    = $nic.IPAddresses -join ", "
            NetworkName  = $nic.VirtualNetwork.Name
        }
    }
}

This script gives a network overview but not live throughput (because SCVMM doesn't directly track bytes sent/received without SCOM).

 


No comments:

Post a Comment