From ypiperea at cisco.com Thu Jun 6 12:01:13 2019 From: ypiperea at cisco.com (Yohan Pipereau (ypiperea)) Date: Thu, 6 Jun 2019 12:01:13 +0000 Subject: [sysrepo-devel] Backup your running datastore Message-ID: Hi sysrepo community, Andrej and I are part of the sweetcomb team which is leveraging sysrepo to expose a YANG interface for FD.io/VPP router. First, many thanks to the sysrepo team for the work you are doing (and libyang, netopeer2 team if they are reading it too). TLDR: ==== If sysrepo crashed, is there a way (even if it is unofficial) to get what was stored in RUNNING datastore before the crash ? Longer explanations: ================= Here is the global scenario: So our goal is to put sysrepo in production systems with VPP router and to handle the case where VPP router and sysrepo would crash. We already have a solution if VPP router crashes but we are lacking a solution in case sysrepo would crash. I can read here http://www.sysrepo.org/static/doc/html/ds_page.html : "Be aware that changes in running datastore are not persistent and will be lost after the application or the system restarts - an explicit copy-config from running to startup datastore is needed to make the changes persistent after restarts". We don't want to use STARTUP datastore. And the reason is simple: -Before sysrepo crashes, RUNNING datastore had the same information as the router state but STARTUP datastore can hold a totally different state. -After sysrepo crashes, we would like to have in RUNNING datastore the same state as the router, i.e. the state before the crash. We can't download this state from the router, because we would need to convert VPP state to YANG and it is not possible (it is only possible to convert YANG state to VPP state). So our solution would be to have the data which were in RUNNING datastore before the crash, and when sysrepo restart we could reapply this data. Do you know if such a thing exist ? I can see persist file in /etc/sysrepo/data, can it be used for this ? Please feel free to ask for more details if I am not making myself clear, Thanks in advance for your help, Yohan From mvasko at cesnet.cz Thu Jun 20 07:29:14 2019 From: mvasko at cesnet.cz (=?utf-8?q?Michal_Va=C5=A1ko?=) Date: Thu, 20 Jun 2019 09:29:14 +0200 Subject: [sysrepo-devel] =?utf-8?q?Backup_your_running_datastore?= In-Reply-To: Message-ID: <275c-5d0b3600-2b-4562e500@127901821> Hi Yohan, yes, you can use the persist file for this (and it is unofficial). Just be aware that in some corner cases the file may be corrupted (sysrepod crashed after all). Regards, Michal On Thursday, June 6, 2019 14:01 CEST, "Yohan Pipereau (ypiperea)" wrote: > Hi sysrepo community, > > Andrej and I are part of the sweetcomb team which is leveraging sysrepo to expose a YANG interface for FD.io/VPP router. > > First, many thanks to the sysrepo team for the work you are doing (and libyang, netopeer2 team if they are reading it too). > > TLDR: > ==== > > If sysrepo crashed, is there a way (even if it is unofficial) to get what was stored in RUNNING datastore before the crash ? > > Longer explanations: > ================= > > Here is the global scenario: > So our goal is to put sysrepo in production systems with VPP router and to handle the case where VPP router and sysrepo would crash. > We already have a solution if VPP router crashes but we are lacking a solution in case sysrepo would crash. > > I can read here http://www.sysrepo.org/static/doc/html/ds_page.html : "Be aware that changes in running datastore are not persistent and will be lost after the application or the system restarts - an explicit copy-config from running to startup datastore is needed to make the changes persistent after restarts". > > We don't want to use STARTUP datastore. And the reason is simple: > -Before sysrepo crashes, RUNNING datastore had the same information as the router state but STARTUP datastore can hold a totally different state. > -After sysrepo crashes, we would like to have in RUNNING datastore the same state as the router, i.e. the state before the crash. We can't download this state from the router, because we would need to convert VPP state to YANG and it is not possible (it is only possible to convert YANG state to VPP state). So our solution would be to have the data which were in RUNNING datastore before the crash, and when sysrepo restart we could reapply this data. Do you know if such a thing exist ? I can see persist file in /etc/sysrepo/data, can it be used for this ? > > Please feel free to ask for more details if I am not making myself clear, > > Thanks in advance for your help, > > Yohan From ypiperea at cisco.com Thu Jun 20 08:53:14 2019 From: ypiperea at cisco.com (Yohan Pipereau (ypiperea)) Date: Thu, 20 Jun 2019 08:53:14 +0000 Subject: [sysrepo-devel] Backup your running datastore In-Reply-To: <275c-5d0b3600-2b-4562e500@127901821> References: <275c-5d0b3600-2b-4562e500@127901821> Message-ID: Hi Michal, Thanks for the information, this might be our best option for the moment. Have a nice day, Yohan > -----Original Message----- > From: Michal Va?ko > Sent: jeudi 20 juin 2019 09:29 > To: Yohan Pipereau (ypiperea) > Cc: sysrepo-devel at sysrepo.org; Andrej Kozem??k > > Subject: Re: Backup your running datastore > > Hi Yohan, > yes, you can use the persist file for this (and it is unofficial). Just be aware > that in some corner cases the file may be corrupted (sysrepod crashed after > all). > > Regards, > Michal > > On Thursday, June 6, 2019 14:01 CEST, "Yohan Pipereau (ypiperea)" > wrote: > > > Hi sysrepo community, > > > > Andrej and I are part of the sweetcomb team which is leveraging sysrepo to > expose a YANG interface for FD.io/VPP router. > > > > First, many thanks to the sysrepo team for the work you are doing (and > libyang, netopeer2 team if they are reading it too). > > > > TLDR: > > ==== > > > > If sysrepo crashed, is there a way (even if it is unofficial) to get what was > stored in RUNNING datastore before the crash ? > > > > Longer explanations: > > ================= > > > > Here is the global scenario: > > So our goal is to put sysrepo in production systems with VPP router and to > handle the case where VPP router and sysrepo would crash. > > We already have a solution if VPP router crashes but we are lacking a > solution in case sysrepo would crash. > > > > I can read here http://www.sysrepo.org/static/doc/html/ds_page.html : > "Be aware that changes in running datastore are not persistent and will be > lost after the application or the system restarts - an explicit copy-config from > running to startup datastore is needed to make the changes persistent after > restarts". > > > > We don't want to use STARTUP datastore. And the reason is simple: > > -Before sysrepo crashes, RUNNING datastore had the same information as > the router state but STARTUP datastore can hold a totally different state. > > -After sysrepo crashes, we would like to have in RUNNING datastore the > same state as the router, i.e. the state before the crash. We can't download > this state from the router, because we would need to convert VPP state to > YANG and it is not possible (it is only possible to convert YANG state to VPP > state). So our solution would be to have the data which were in RUNNING > datastore before the crash, and when sysrepo restart we could reapply this > data. Do you know if such a thing exist ? I can see persist file in > /etc/sysrepo/data, can it be used for this ? > > > > Please feel free to ask for more details if I am not making myself clear, > > > > Thanks in advance for your help, > > > > Yohan > >