Comments (17)
And how can I access a VM from a node out of Kubernetes cluster?
from virtink.
Hi @dyoung23 , could you try with newer versions of kubectl, for example v1.21.x? There's a chance that this is a limitation of v1.20.x's kubectl, but the API is OK. But that's just my guess. Otherwise, I'm afraid there's no easy way to do this for now.
To access a VM outside the Kubernetes cluster, it's pretty much same as accessing a Pod. You can forward SSH port using kubectl, or using NodePort or LB service to expose SSH port.
from virtink.
@fengye87 Thanks for you reply. I updated my Kubernetes to v1.24.0,so I can manage the vm like Readme and I am looking if the API can manage the VM.
But I try to manage the VM using kubectl patch ...
and find that when I Shutdown
or Reset
the vm,nothing happend,I can still ssh to the vm just get some new events in virtualmachine CRD like that.
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal CreatedVMPod 25m virt-controller Created VM Pod "vm-ubuntu-container-rootfs-9rmwk"
Normal Paused 8m43s virt-daemon Paused VM
Normal Resumed 7m53s virt-daemon Resumed VM
Normal Rebooted 7m9s virt-daemon Rebooted VM
Normal PoweredOff 5m32s virt-daemon Powered off VM
Normal DeletedVMPod 5m32s virt-controller Deleted VM Pod "vm-ubuntu-container-rootfs-9rmwk"
Normal CreatedVMPod 5m18s virt-controller Created VM Pod "vm-ubuntu-container-rootfs-jbpmd"
Normal Shutdown 67s (x2 over 2m18s) virt-daemon Shutdown VM
Normal Reset 14s virt-daemon Reset VM
from virtink.
@dyoung23 Shutdown
is ACPI shutdown, it requires OS's support to work. Reset
should work, are you sure nothing happened?
from virtink.
@fengye87 I create a file in my vm and Reset
.After that I can still ssh to this vm and see the file.
from virtink.
@dyoung23 Reset is like force reboot, it will not reset VM's hard disk.
from virtink.
@fengye87 I see.Maybe it be reset really fast,so I can ssh to the vm all the time.
from virtink.
@dyoung23 If you reset the VM while SSH logged in, it should log you out. Otherwise, there's something wrong with the reset action.
from virtink.
@fengye87 Yes,It really log out
from virtink.
@dyoung23 Then it means your VM really got reset.
from virtink.
@fengye87 Yes.Thank you.
I thought how to manage VM using API,do we provide an official API or client to access Virtink?
from virtink.
@dyoung23 Yes, there's a plan to add direct API support for VM power actions. It should arrive in the next release.
from virtink.
Hope the next release coming soon with a officail dashboard better.
from virtink.
@fengye87 I doubt how can I get the vm status using kubectl except from Events which will clear after a long time.
from virtink.
@dyoung23 The VM's status
have a phase
field, you can get VM status (like if the VM is running) from this field.
from virtink.
@fengye87 But this phase field is really different with the power action.For example,I pause a vm,I only can get Running
status,but I can't know it's paused from the status.
from virtink.
@dyoung23 Good point. We shall improve this in the future.
from virtink.
Related Issues (20)
- Connect VM to kube-ovn logical_switch and fix ip address HOT 1
- create bridge: file exists HOT 1
- Add Kubernetes Health Checks CRD HOT 2
- Cannot access internet, DNS resolves to Kubernetes DNS timesout HOT 4
- How to set the size of root disk vm when using container root fs HOT 1
- Does virtink support mount a PVC into some path in vm? HOT 4
- Could we exec the vm by using kubectl exec if sshd died in the vm? HOT 4
- VM network isn't reacheable with flannel CNI HOT 4
- Is there any examples for using a Block pvc as root disk? HOT 8
- Could we mount hostPath into the virtual machine? HOT 1
- VM could not start in centos:7 for kernel 3.10.0-1160.45.1.el7.x86_64 but work in 5.4.15-1.el7.elrepo.x86_64 HOT 4
- multus network with bridge cni plugins HOT 5
- ch.sock: connect: no such file or directory HOT 11
- DataVolume GC cause VM deployment failure HOT 1
- Does not work in a KinD cluster HOT 6
- Bridge interface down HOT 2
- Failed to start Apply the …ngs specified in cloud-config. #28 HOT 2
- Question: do the vm in network mode bridge + multus support live migration? HOT 1
- Is virtink actively maintained/developed?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtink.