Git Product home page Git Product logo

vm-import-operator's Introduction

vm-import-operator

Operator which imports a VM from oVirt to KubeVirt.

Designs

Installation

Installation has to be made into KubeVirt installation namespace. Default kubevirt namespace is assumed to be 'kubevirt-hyperconverged'. In order to generate manifests for a different namespace run:

TARGET_NAMESPACE=YOUR_DESIRED_NAMESPACE make gen-manifests

Deploy vm-import-operator resources:

kubectl apply -f https://github.com/kubevirt/vm-import-operator/releases/download/v0.3.0/operator.yaml
kubectl apply -f https://github.com/kubevirt/vm-import-operator/releases/download/v0.3.0/vmimportconfig_cr.yaml

Import virtual machine from oVirt

Create a secret with oVirt credentials:

cat <<EOF | kubectl create -f -
---
apiVersion: v1
kind: Secret
metadata:
  name: my-secret-with-ovirt-credentials
  namespace: default
type: Opaque
stringData:
  ovirt: |
    apiUrl: "https://ovirt-engine.example.com:8443/ovirt-engine/api"
    username: admin@internal # provided in the format of username@domain
    password: 123456
    caCert: |
      -----BEGIN CERTIFICATE-----
      ...
      -----END CERTIFICATE-----
EOF

The CA Certificate can be obtained from oVirt according to the instructions specified here.

Create oVirt resource mappings that defines how oVirt resources are mapped to kubevirt:

cat <<EOF | kubectl create -f -
apiVersion: v2v.kubevirt.io/v1beta1
kind: ResourceMapping
metadata:
  name: example-resourcemappings
  namespace: example-ns
spec:
  ovirt:
    networkMappings:
      - source:
          name: ovirtmgmt/ovirtmgmt
        target:
          name: pod
        type: pod
    storageMappings:
      - source:
          name: ovirt_storage_domain_1
        target:
          name: storage_class_1
EOF

Create VM Import resource for importing a specific VM from oVirt to KubeVirt:

cat <<EOF | kubectl create -f -
apiVersion: v2v.kubevirt.io/v1beta1
kind: VirtualMachineImport
metadata:
  name: example-virtualmachineimport
  namespace: default
spec:
  providerCredentialsSecret:
    name: my-secret-with-ovirt-credentials
    namespace: default # optional, if not specified, use CR's namespace
  resourceMapping:
    name: example-resourcemappings
    namespace: othernamespace
  targetVmName: testvm
  startVm: false
  source:
    ovirt:
      vm:
        id: 80554327-0569-496b-bdeb-fcbbf52b827b
EOF

Verify VM Import resource was created:

kubectl get vmimports example-virtualmachineimport -n default

Wait for VM Import resource to complete:

kubectl wait vmimports example-virtualmachineimport -n default --for=condition=Succeeded

View vm-import logs:

kubectl logs -n kubevirt-hyperconverged deploy/vm-import-controller

An example of a VM Import resource during creation:

apiVersion: v2v.kubevirt.io/v1beta1
kind: VirtualMachineImport
metadata:
  annotations:
    vmimport.v2v.kubevirt.io/progress: 20
  name: example-virtualmachineimport
  namespace: default
spec:
  source:
  ...
status:
  targetVmName: myvm
  conditions:
    - lastTransitionTime: "2020-02-20T12:43:10Z"
      status: "False"
      type: Succeeded
      reason: DataVolumeCreationFailed
      message: VM import due to failure to copy source VM disks to kubevirt.
    - lastTransitionTime: "2020-02-20T12:43:10Z"
      status: "False"
      type: Processing
      reason: CopyingDisk
      message: VM disks are being copied to destination.
  dataVolumes: # list of data volumes created for the VMs
    - name: dv-myvm-1
    - name: dv-myvm-2

How to contribute

To learn how to contribute, please refer to contribution guide.

vm-import-operator's People

Contributors

aufi avatar dankenigsberg avatar fabiendupont avatar jakub-dzon avatar machacekondra avatar mansam avatar masayag avatar nunnatsa avatar pkliczewski avatar suomiy avatar ydayagi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.