cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2893
Views
0
Helpful
4
Replies

VTP on UCS?

minghui.qi
Level 1
Level 1

Hi all,

I need to create about 100 vlans on the UCS fabric interconnect cluster uplinking to nexus 7K, couldn't find a way get UCS to learn vlans using VTP or something like that. I prepared the command list to run with in CLI, which is still a lot of work, because for after each create vlan command, I need to add "exit" command to return to the previous mode, otherwise the next "create vlan" command won't work - different from Cat switches.

does UCS blade system support VTP? what is the easiest way to create that many vlans?

thanks

2 Accepted Solutions

Accepted Solutions

Lucien Avramov
Level 10
Level 10

UCS does not support VTP as this point.

I suggedt you  to make a small script in your notepad and paste this on the fabric interconnect CLI.

View solution in original post

Robert Burns
Cisco Employee
Cisco Employee

Just to add to what Lucien pointed out, you can copy & paste your CLI commands from a text editor such as notepad into the CLI.

Ex.

scope eth-uplink
create vlan accounting 2000
exit
create vlan hr 2001
exit
create vlan finance 2002
exit
create vlan techsupport 2003
exit
create vlan management 2004
exit
commit-buffer

Log into the CLI of your VIP and paste your VLAN config for a much faster import than the GUI.

VTP Transparent mode support is coming, but not available today.

Robert

View solution in original post

4 Replies 4

Lucien Avramov
Level 10
Level 10

UCS does not support VTP as this point.

I suggedt you  to make a small script in your notepad and paste this on the fabric interconnect CLI.

Robert Burns
Cisco Employee
Cisco Employee

Just to add to what Lucien pointed out, you can copy & paste your CLI commands from a text editor such as notepad into the CLI.

Ex.

scope eth-uplink
create vlan accounting 2000
exit
create vlan hr 2001
exit
create vlan finance 2002
exit
create vlan techsupport 2003
exit
create vlan management 2004
exit
commit-buffer

Log into the CLI of your VIP and paste your VLAN config for a much faster import than the GUI.

VTP Transparent mode support is coming, but not available today.

Robert

minghui.qi
Level 1
Level 1

thanks guys, that is what I did, seems that there is no easier ways, hope VTP is coming soon :D. It took me a while to prepare the convert the "show vlan" output from uplink switches into script for UCS, as it's about 110 vlans.

You can (and probably should) use the XML API to create many VLANs in one go. Here's some sample code that will do this for you. All you need is Perl and a text file that contains  vlan_name,vlan_number  lines.

#!/usr/bin/perl
#
# UCS API Perl script to create contiguous range of N VLANs
#
# cpaggen at cisco dot com
#
# input file format is
#   vlan_name,number
# eg:
#   foo,666
#   bar,667
#   foobar,800

use strict;
use warnings;
use Getopt::Long;
use LWP::UserAgent;
use HTTP::Request::Common;

$|++;

GetOptions( "ip=s"=>\my $ip,
            "user=s"=>\my $user,
            "password=s"=>\my $password,
            "f=s"=>\my $configfile,
        "help!"=> \my $help) or die "Incorrect usage - type --help for guidelines\n";


if ((!defined($configfile) || !defined($ip) || !defined($password) || !defined($user)) || ($help) )
{
    die ("createvlans -ip -user -password -f \n");
}

my $browser = LWP::UserAgent->new(agent => 'perl post');
my $xmlcmd = "";

my $url = 'http://'.$ip.'/nuova';
my $xml_header = "";
my $request = HTTP::Request->new(POST => $url);
$request->content_type("text/xml; charset=utf-8");
$request->content($xmlcmd);

my $response = $browser->request($request);
if ($response->content =~ m/errorDescr=\"([a-zA-Z0-9_\-\. ]+)\".*/)
{
    die ("Login failure: ".$1."\n");
}

# cookie format: outCookie="1263997145/efd499ed-cd2e-4128-8de7-16598d80d8c9"

$response->content =~ m/outCookie=\"(\d{10}\/\w{8}\-\w{4}\-\w{4}\-\w{4}\-\w{12})\".*/;
my $ucscookie = $1;
print ("Login successful - obtained UCS cookie ".$ucscookie."\n");

open (my $in, $configfile);
while (<$in>)
{
  chomp;
  my @vlan=split(",",$_);
  print ("Creating vlan ".$vlan[0]." (".$vlan[1].")\n");
  my $xmlcmd = "
                  
                   
                    
                    

                   

                         

                       
";
        $request->content($xmlcmd);
        $response = $browser->request($request);
        if ($response->content =~ m/status=\"created\"/)
    {
      print (" ... success\n");
    } else
          {
            print (" ... error\n");
      }
}

Review Cisco Networking for a $25 gift card

Review Cisco Networking for a $25 gift card