<h2>CNO - MID frequent restarts</h2><br/><div style="overflow-x:auto"><h1 style="margin: 12pt 0cm 0cm; break-after: avoid; font-size: 16pt; font-family: 'Calibri Light', sans-serif; color: #2f5496; font-weight: normal;">The background</h1> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">MID container is created with memory resources defined in the table <strong>sn_cno_resources</strong>.</p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">If Metric Intelligence plugin is not installed, the CNO uses by default the small memory model, which sets <span class="ui-provider">the memory value to </span>1,200 MB.</p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">MID JVM memory max size should not exceed the container memory size and by default it is set as following: container a memory size multiplied by the ratio 0.8. So currently it is 960 MB.</p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;"> </p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">We found out, that the above memory settings doesn’t meet, if customer's cluster is busy. When the cluster discovery is running the MID memory is growing beyond the allocated limit of the container memory, this causes the Kubernetes to kill the container.</p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;"> </p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">The procedure below suggests how to change the resources settings.</p> <h1 style="margin: 12pt 0cm 0cm; break-after: avoid; font-size: 16pt; font-family: 'Calibri Light', sans-serif; color: #2f5496; font-weight: normal;">How to fix existing deployments</h1> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">For the existing deployments the changes may be done on the cluster itself.</p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">We suggest doing the changes first on one cluster and then if this is successful, repeat the same on the rest of the clusters.</p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;"> </p> <ol style="margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Change MID container memory limit on a cluster with the command:</li></ol> <p style="margin: 0cm 0cm 0cm 18pt; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: Consolas;">kubectl edit statefulset sn-acc-mid -n servicenow</span></p> <p style="margin: 0cm 0cm 0cm 18pt; font-size: 12pt; font-family: Calibri, sans-serif;"> </p> <p style="margin: 0cm 0cm 0cm 18pt; font-size: 12pt; font-family: Calibri, sans-serif;">This will open vi editor. Navigate to definitions of container memory resources and change it to 2Gi as it is shown on the snapshot below:</p> <p style="margin: 0cm 0cm 0cm 18pt; font-size: 12pt; font-family: Calibri, sans-serif;"><img src="/sys_attachment.do?sys_id=7d0d57d39330bd108960fb2d6cba1061" width="378" height="116" /></p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;"> </p> <ol style="margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;" start="2"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Run the cluster discovery: <ol style="list-style-type: lower-alpha; margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Navigate to the <strong>Discovery Schedules</strong></li><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Set filter *Kubernetes.</li><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Add MID Server column to the view.</li></ol> </li></ol> <p style="margin: 0cm 0cm 0cm 72pt; font-size: 12pt; font-family: Calibri, sans-serif;"><img src="/sys_attachment.do?sys_id=c20d97d39330bd108960fb2d6cba10ac" width="283" height="107" /></p> <ol style="margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;" start="3"><li style="list-style: none; margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;"> <ol style="list-style-type: lower-alpha; margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Open the schedule entry for the MID of the cluster that was edited in the previous step and press ‘Discover now’.</li></ol> </li></ol> <p style="margin: 0cm 0cm 0cm 72pt; font-size: 12pt; font-family: Calibri, sans-serif;"><img src="/sys_attachment.do?sys_id=4a0d1bd39330bd108960fb2d6cba108e" width="355" height="192" /></p> <ol style="margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;" start="4"><li style="list-style: none; margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;"> <ol style="list-style-type: lower-alpha; margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;" start="2"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">After pressing on ‘Discover now’ the discovery status will be popped up. Open its record and wait for discovery finish.</li></ol> </li><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">If the step 2 is successful, repeat steps 1,2 for the rest of the clusters.</li></ol> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;"> </p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;"><strong><u>Note:</u></strong> Alternative to edit the statefulset, the CNO may be redeployed after making the necessary changes on the instance itself, like this is explained below.</p> <h1 style="margin: 12pt 0cm 0cm; break-after: avoid; font-size: 16pt; font-family: 'Calibri Light', sans-serif; color: #2f5496; font-weight: normal;">The instance changes</h1> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;">The changes on instance should be done for new deployments or redeploying of existing deployments.</p> <ol style="margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Navigate to the table <strong>sn_cno_resources </strong>and edit the record of SN_ACC_MID container for <strong>Small</strong> memory model as following:</li></ol> <ul style="margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Memory Limit: 2</li><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Memory Limit Unit: Gi</li></ul> <p style="margin: 0cm 0cm 0cm 18pt; font-size: 12pt; font-family: Calibri, sans-serif;"><img src="/sys_attachment.do?sys_id=120dd7d39330bd108960fb2d6cba10b8" width="468" height="102" /></p> <ol style="margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;" start="2"><li style="margin: 0cm 0cm 0cm 0px; font-size: 12pt; font-family: Calibri, sans-serif;">Navigate to the <strong>sys_properties</strong> table and create the system property <span class="ui-provider"><strong>sn_k8s.mid_wrapper_memory_allocation_ratio</strong></span><span class="ui-provider"> with the value 0.6:</span> <ol style="list-style-type: lower-alpha; margin-bottom: 0cm; margin-top: 0px; list-style-position: inside;"><li>Select the application: <strong>Cloud Native Operations </strong></li><li>Set the suffix: <strong>mid_wrapper_memory_allocation_ratio</strong></li><li>Set the type: <strong>string</strong></li><li>Set the value: <strong>0.6</strong></li></ol> </li></ol> <p style="margin: 0cm 0cm 0cm 18pt; font-size: 12pt; font-family: Calibri, sans-serif;"><span class="ui-provider"><img src="/sys_attachment.do?sys_id=ca0d9bd39330bd108960fb2d6cba108f" width="468" height="142" /></span></p> <p style="margin: 0cm; font-size: 12pt; font-family: Calibri, sans-serif;"> </p></div>