VTP on UCS?

Answered Question
Apr 20th, 2010
User Badges:

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

Correct Answer by Robert Burns about 6 years 11 months ago

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

Correct Answer by Lucien Avramov about 6 years 11 months ago

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
Lucien Avramov Tue, 04/20/2010 - 21:16
User Badges:
  • Red, 2250 points or more

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.

Correct Answer
Robert Burns Tue, 04/20/2010 - 21:36
User Badges:
  • 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 Wed, 04/21/2010 - 19:58
User Badges:

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.

cpaggen Sun, 04/25/2010 - 01:48
User Badges:
  • Cisco Employee,

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 = "<?xml version='1.0'?>";
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");
      }
}

Actions

This Discussion