05-08-2016 06:36 AM - edited 03-12-2019 07:21 AM
We currently have the Cisco CSR 1000V deployed in the AWS environment and utilize the user-data field for bootstrapping our automated deployments. So far we have had no issues with utilizing the user-data format outlined in the Documentation. We recently needed to make some customizations to the logging configuration specifically adding logging origin-id and wanted to use a custom string that included spaces. In order to include a custom string with spaces you are required to surround/delimit the string with quotes.
A working example of this is shown below if entered on config t mode or in a running configuration of a CSR1000v
hostname Router-Hostname
service timestamps debug datetime msec year
service timestamps log datetime msec year
logging trap debugging
logging facility syslog
logging origin-id string "host='Router-Hostname' random-other-string"
Which would translate to below when supplying as user-data for bootstrapping:
ios-config-0001="hostname Router-Hostname"
ios-config-0002="service timestamps debug datetime msec year"
ios-config-0003="service timestamps log datetime msec year"
ios-config-0004="logging trap debugging"
ios-config-0005="logging facility syslog"
ios-config-0006="logging origin-id string "host='Router-Hostname' random-other-string""
The issue is that the above userdata causes the CSR1000V to fail first boot. There are no error messages or console information provided however the moment I remove the quotes the issue is no longer seen. I suspect that there are limitations to the characters allowed in the userdata format.
As mentioned if the commands are entered into a running CSR1000V no issues are seen and the behavior is as expected.
Is there any way to debug the parsing of the user-data provided during first boot? Is there another means for me to boot strap the above command that will behave as expected, perhaps escaping the quotes or something? Every time I try to test an alternative I have to wait 15 minutes to find out that it will fail since the CSR takes often times more then 10 minutes to boot.
Thanks,
Daniel
05-24-2016 09:41 PM
Hi Daniel,
Have a try on this
ios-config-0006="logging origin-id string \"host='Router-Hostname' random-other-string\""
Thanks
Fan
06-03-2016 04:05 AM
Hi,
doesnt work for me either.
The " is needed for directly adding the csr_mgmt EEM restart template or the CSR HA EEM directly with CloudFormation.
Any new ideas here ?
06-06-2016 08:05 PM
Hi Daniel,
How about ios-config-0006="logging origin-id string \"host=\'Router-Hostname\' random-other-string\""
Thanks
Fan
12-08-2016 03:49 PM
Hi Daniel,
I know this is probably too late for you, but in case anyone come across this post. I have found the escape. You have to use XML escape if you want to pass special characters.
Please use " for " and ' for '
In your case
ios-config-0006="logging origin-id string "host='Router-Hostname' random-other-string""
Thanks
Fan
02-17-2018 05:47 AM
Fan,
Thank you so much for this! I have spent several days looking for a solution to this problem. Your XML escape work perfectly!
Thanks,
Chris
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide