[c-nsp] Cisco CNS initial configuration
Brett Wooldridge
brett.wooldridge at gmail.com
Tue Dec 22 07:04:52 EST 2009
Hello list,
I am trying to build a provisioning solution that uses Cisco CNS' initial
configuration facility. Initial configuration is a facility by which a
device, when booted with a minimal bootstrap obtains it's configuration via
HTTP(S). However, it seems there is scant documentation available on doing
so. Cisco provides documentation on how to configure a device's CNS agent
for initial configuration, but no documentation on the internals of how that
configuration is delivered. The only solutions that seem capable of
delivering initial configuration are Cisco's own products. However, CNS and
it's netconf-based XML schemas was meant to provide an "open" API to
developers, provisioners, and engineers.
I have a device (a Cisco 3640) that is configured with an initial bootstrap,
like so:
!
Version 12.4
!
cns config connect-intf FastEthernet ping-interval 30 retries 3
config-cli description Deployment test
config-cli ip address dhcp
config-cli no shutdown
config-cli ip route 0.0.0.0 0.0.0.0
exit
!
cns id string 12345678
cns config initial 192.168.0.111 page /ciscocns
!
end
And when the device boots, it does indeed hit my web server running at
192.168.0.111 at the appropriate URL. However, when I try to deliver an
initial configuration, I get an error on the device saying that the XML is
invalid. Which is not surprising given that I've had to try to make an
educated guess as to what the device is expecting.
What I'd like to do is blast a standard "startup-config", in standard form
(same as obtained from 'show startup-config'), down to the device. I am
aware that the device is expecting netconf-like XML. However, how exactly
to encapsulate the configuration text in XML is where I seem to be failing.
And therefore, I'm asking for some help here from anyone with CNS
experience.
What I'm currently sending the device is this:
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<rpc message-id="123" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<edit-config>
<target><startup/></target>
<default-operation>replace</default-operation>
<test-option>test-then-set</test-option>
<error-option>stop-on-error</error-option>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"
xc:operation="replace">
<cli-config-data-block>
... config text here ...
</cli-config-data-block>
</edit-config>
</rpc>
I know this is a rather esoteric question, that's why I'm dipping deep into
the well of Cisco knownledge here. Any ideas or suggestions?
TIA,
Brett
More information about the cisco-nsp
mailing list