Load configuraiton (xml format) cause my configuration elements missing

Hi there,

My private YANG model are load succssfullyI, but afterI using <./confd_load -ldD han2.cfg> to load xml configuration file into confd, when I login again the configuration is loaded sucessfully, but the model nodes are missing. I cannot configure them again under configure mode?

how can I fix this problem? do they also encounter such issue?

Hi,

I suspect that after using the “-D” option running “maapi_delete_all(MAAPI_DEL_ALL)” in your han2.cfg file you did not include the configuration from the aaa_init.xml file that comes with the examples.

In the 1-2-3-start-query-model example (and most other examples) the aaa_init.xml is copied into the confd-cdb directory by the Makefile (include.mk) and imported from there by ConfD at startup .

yes, you are right, when I reload /var/confd/cdb/aaa_init.xml, my private model element are present in configure mode.

I guess this is bug for mappi_delete_all() API if I used “-D” parameters.

and also I try to reload xml configuraiton file without “-D” paremeters. like <./confd_load -l han2.cfg>, same error encouters.

I wouldn’t call it a bug, you say you want to delete all configuration and maapi_delete_all() does just that for you.

Since the default mode of confd_load -l my_config.xml is to delete and replace the configuration, you will delete the configuration before loading what is in the my_config.xml file.
Use the -m option to merge or -r to just replace the configuration.

$ confd_load -h
A utility that saves and loads the running configuration, usage: 
    confd_load [options] [filename]
    confd_load -l [options] [filename...]
    confd_load -C [-R] [filename...]
 Valid options are (for further details, see the manpage):
    -d            debug flag
    -l            load config into ConfD [default is to save]
    -F x|p|o|j|c|i format (one of x(ml), p(retty xml), json or
                  j, c, i (-style cli)) [default is xml]
    -W            include default values
    -S            include default values as comments
    -m            when loading config, merge [default is delete and replace]
    -r            when loading config, replace [default is delete and replace]
    -H            hide all hidden nodes [default depends on transaction]
    -U            unhide all hidden nodes [default depends on transaction]
    -a            when loading 'c' or 'i' config, commit after each line
    -e            when loading, do not abort on errors
    -p  <path>    when saving the path to save
                  when loading this path will first be deleted
    -N            when saving, do Not include parents to the path
    -P  <xpath>   when saving apply this xpath filter
    -D            do maapi_delete_all(MAAPI_DEL_ALL) before loading
    -o            when saving include operational data
                  when loading ignore operational data
    -u  <user>    use this user
    -g  <group>   use this group (may be repeated)
    -c  <context> use this context [default is 'system']
    -i            attach to init session instead of starting new session
    -s            start transaction towards startup [default is running]
    -O            start operational transaction (load oper data via a
                  maapi transaction instead of via CDB)
    -t            measure how long the requested command takes

    -C            load filename into CDB operational
    -R            generate CDB operational subscription notifications

Thanks. the replace flag can resolve this question.