Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2015853

Summary: [Doc] RN: Setting interval between precopies
Product: Migration Toolkit for Virtualization Reporter: Avital Pinnick <apinnick>
Component: DocumentationAssignee: Sasha Beskin <sbeskin>
Status: CLOSED CURRENTRELEASE QA Contact: Maayan Hadasi <mguetta>
Severity: high Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 2.2.0CC: apinnick, cnv-qe-bugs, fdupont, istein, mguetta, nantonel, sbeskin, slucidi
Target Milestone: ---   
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2012738 Environment:
Last Closed: 2021-12-12 10:39:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2012738    
Bug Blocks: 1955263    

Description Avital Pinnick 2021-10-20 09:19:13 UTC
This needs to be added to "Technological changes" section of MTV 2.2.0 release notes.

+++ This bug was initially created as a clone of Bug #2012738 +++

Description of problem:
Looks like the interval time between precopies in warm migration stays 60 minutes, although configmap/vm-import-controller-config was patched

oc command to change the interval time:
$ oc patch configmap/vm-import-controller-config -n openshift-cnv -p '{"data": {"warmImport.intervalMinutes": "3"}}'
configmap/vm-import-controller-config patched


$ oc get configmap/vm-import-controller-config -nopenshift-cnv -oyaml
apiVersion: v1
data:
  warmImport.intervalMinutes: "3"
kind: ConfigMap
metadata:
  creationTimestamp: "2021-10-05T08:55:09Z"
  name: vm-import-controller-config
  namespace: openshift-cnv
  resourceVersion: "7858476"
  uid: b34163e4-cdb6-479e-9d4f-db55baa1f46f


$ oc describe plan mig-plan-warm
...
      Warm:
        Consecutive Failures:  0
        Failures:              0
        Next Precopy At:       2021-10-11T07:47:19Z
        Precopies:
          Completed:    2021-10-11T06:47:19Z
          Snapshot:     snapshot-7858
          Started:      2021-10-11T06:41:02Z
        Successes:      0
  Observed Generation:  1
Events:
  Type    Reason  Age   From  Message
  ----    ------  ----  ----  -------
  Normal  Ready   44m   plan  The migration plan is ready.



Version-Release number of selected component (if applicable):
MTV 2.2.0-39 / iib: 121326
CNV 4.9.0-232 / iib: 117863


How reproducible:
100%


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Fabien Dupont on 2021-10-11 12:13:54 UTC ---

I've updated the Product to MTV, since you're apparently not using VMIO API.
In MTV 2.2, the interval is not set in HCO or VMIO, because we don't use VMIO anymore. So, we need to update the documentation.

@slucidi, could you please explain how to set the interval ?

--- Additional comment from Sam Lucidi on 2021-10-12 19:32:51 UTC ---

The precopy interval is now set as an environment variable on the forklift-controller pod's `controller` container. In order to adjust it, you need to add `PRECOPY_INTERVAL` with a value in minutes to the `env` section of the `controller` container definition on the `forklift-controller` deployment, or add the key `PRECOPY_INTERVAL` with a value in minutes to the `forklift-controller-config` config map and restart the controller pod.

Example of setting the environment variable on the deployment:

kind: Deployment
apiVersion: apps/v1
metadata:
  name: forklift-controller
  namespace: konveyor-forklift
  <...>
spec:
  template:
    spec:
      restartPolicy: Always
      serviceAccountName: forklift-controller
      schedulerName: default-scheduler
      terminationGracePeriodSeconds: 10
      securityContext: {}
      containers:
        - resources:
            limits:
              cpu: 500m
              memory: 800Mi
            requests:
              cpu: 100m
              memory: 350Mi
          terminationMessagePath: /dev/termination-log
          name: controller
          command:
            - /usr/local/bin/manager
          env:
            - name: PRECOPY_INTERVAL
              value: 60
     <...>

Example with the forklift-controller-config config map:

kind: ConfigMap
apiVersion: v1
metadata:
  name: forklift-controller-config
  namespace: konveyor-forklift
  <...>
data:
  PRECOPY_INTERVAL: '60'
  WORKING_DIR: /var/cache/inventory

--- Additional comment from Maayan Hadasi on 2021-10-14 09:40:28 UTC ---

Thanks @slucidi for providing this information (comment #2)

Both options were checked and the interval time between precopies has been changed accordingly.
I noticed that the PRECOPY_INTERVAL environment variable on the `forklift-controller` deployment is what counts in case of PRECOPY_INTERVAL is set in both places
(`forklift-controller` deployment and `forklift-controller-config` configMap)
Could you please confirm this is expected?

--- Additional comment from Sam Lucidi on 2021-10-15 18:09:39 UTC ---

Yes, that is expected.

Comment 2 Sasha Beskin 2021-12-07 09:45:21 UTC
Included in MTV 2.2 Release Notes
PR:
https://github.com/konveyor/forklift-documentation/pull/241
Ready for QE

Comment 5 Sasha Beskin 2021-12-12 10:39:37 UTC
Included in MTV 2.2 Release Notes
Merged