Git Product home page Git Product logo

Comments (20)

woodwardmatt avatar woodwardmatt commented on May 28, 2024 7

I'm sharing this having gone through the same battle yesterday with the kubectl run command. If you're running this on Windows using Powershell you'll need to create a variable and assign the JSON (using the ConvertTo-Json routine) first. Then use that variable in your kubectl commands.

From the OP's code:

$ kubectl patch offlinevirtualmachine testvm --type merge -p '{"spec":{"running":true}}'

Becomes:

$myjson = '{"spec":{"running":true}}' | ConvertTo-Json
$ kubectl patch offlinevirtualmachine testvm --type merge -p $myjson

Hope that helps! :)

Approach originally found at: https://stackoverflow.com/a/53481499/40593

from demo.

drpaneas avatar drpaneas commented on May 28, 2024 1

Yes. Check this: https://www.virtualbox.org/ticket/4032
9 years ...

from demo.

ffromani avatar ffromani commented on May 28, 2024 1

thanks for the correction @stealthybox !

from demo.

fabiand avatar fabiand commented on May 28, 2024

virt-controller-5c74754ddd-tbhkf is just a hot-standby in case that the primary controller has an issue.

Could you please provide the output of kubectl get ovm testvm?

It might be that something is up with the offline VM definition

from demo.

drpaneas avatar drpaneas commented on May 28, 2024

kubectl get ovm testvm

C:\minikube>kubectl get ovm testvm
NAME      AGE
testvm    1d

Nothing fancy here :/

from demo.

fabiand avatar fabiand commented on May 28, 2024

Argh - kubectl get ovm testvm -o yaml I mean to say - to get all the details.

from demo.

fabiand avatar fabiand commented on May 28, 2024

You are testing on Windows!? Crazy :)

from demo.

drpaneas avatar drpaneas commented on May 28, 2024

Shit! I know why it's failing... or at least this my lucky guess:

virtual-box is unable of running KVM inside of it. It's not supported. Minikube in windows is using Virtual-box, so ... I will try this on my Linux box also to make sure if it's a bug or not, and then update the status here.

from demo.

fabiand avatar fabiand commented on May 28, 2024

Cool.

Are you sure it is not supported by today? KVM inside VB? ...

from demo.

fabiand avatar fabiand commented on May 28, 2024

Oh - But never the less - We noticed that currently all VMs are run in emualtion mode. So this should not be the issue.

from demo.

drpaneas avatar drpaneas commented on May 28, 2024

In Linux it works perfectly OK. So, the issue is triggered only in Windows environment.

from demo.

fabiand avatar fabiand commented on May 28, 2024

Can you provide the output of kubectl get ovm testvm -o yaml ?

from demo.

fabiand avatar fabiand commented on May 28, 2024

ping?

from demo.

drpaneas avatar drpaneas commented on May 28, 2024

Ah I forgot about this. Let me resurrect my Windows machine. I will report soon-ish. Thank for the reminder ;)

from demo.

drpaneas avatar drpaneas commented on May 28, 2024
apiVersion: kubevirt.io/v1alpha1
kind: OfflineVirtualMachine
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"kubevirt.io/v1alpha1","kind":"OfflineVirtualMachine","metadata":{"annotations":{},"name":"testvm","namespace":"default"},"spec":{"running":false,"selector":{"matchLabels":{"guest":"testvm"}},"template":{"metadata":{"labels":{"guest":"testvm","kubevirt.io/size":"small"}},"spec":{"domain":{"devices":{"disks":[{"disk":{"bus":"virtio"},"name":"registrydisk","volumeName":"registryvolume"},{"disk":{"bus":"virtio"},"name":"cloudinitdisk","volumeName":"cloudinitvolume"}]}},"volumes":[{"name":"registryvolume","registryDisk":{"image":"kubevirt/cirros-registry-disk-demo"}},{"cloudInitNoCloud":{"userDataBase64":"SGkuXG4="},"name":"cloudinitvolume"}]}}}}
  clusterName: ""
  creationTimestamp: 2018-03-11T01:18:34Z
  generation: 0
  name: testvm
  namespace: default
  resourceVersion: "3371"
  selfLink: /apis/kubevirt.io/v1alpha1/namespaces/default/offlinevirtualmachines/testvm
  uid: 1e7a9b22-24ca-11e8-be68-080027a81666
spec:
  running: false
  selector:
    matchLabels:
      guest: testvm
  template:
    metadata:
      labels:
        guest: testvm
        kubevirt.io/size: small
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: registrydisk
            volumeName: registryvolume
          - disk:
              bus: virtio
            name: cloudinitdisk
            volumeName: cloudinitvolume
      volumes:
      - name: registryvolume
        registryDisk:
          image: kubevirt/cirros-registry-disk-demo
      - cloudInitNoCloud:
          userDataBase64: SGkuXG4=
        name: cloudinitvolume

Here it is.

from demo.

fabiand avatar fabiand commented on May 28, 2024

Closing this issue as the entities were renamed.

from demo.

fabiand avatar fabiand commented on May 28, 2024

Please reopen or file new if you still see this. Please provide:

Exact kubectl/oc cmdline
Exact VM/VMI definitnion.

from demo.

ffromani avatar ffromani commented on May 28, 2024

Hey, I stumbled on this issue today. Seems a kubernetes issue:
kubernetes/kubernetes#63247
(also relevant: kubernetes/kubernetes#56980)

I workarounded this issue using a YAML patch. No luck with JSON patch
platform: kubevirt 0.8.0 on kubernetes 1.11

from demo.

stealthybox avatar stealthybox commented on May 28, 2024

@fromanirh there shouldn't be any issues parsing valid JSON, as it is a subset of YAML.
You likely had an error in your JSON which was not present in your YAML version of the patch.

The linked issues are mainly about UX of the jsonpatch feature. (it's confusing)
The parsing works correctly.

from demo.

fabiand avatar fabiand commented on May 28, 2024

That's crazy ...

@woodwardmatt do I understand that you ran minikube on Windows and KubeVirt inside of minikube?

from demo.

Related Issues (20)

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.