i am unable to create a windows VM in anthos bare metal using iso file when i am following google article first to configs created successfully but on the third config it shows error:-error: resource mapping not found for name: "" namespace: "" from "windows-vm.yaml": no matches for kind "VirtualMachine" in version "vm.cluster.gke.io"
ensure CRDs are installed first
i am unable to resolve this issue. can any one help me out hear
doc i am following:-https://cloud.google.com/anthos/clusters/docs/bare-metal/latest/vm-runtime/windows-vm
Hi @chetanchoudhery - Thanks for reaching out!
My understanding is that you are receiving the 'no matches for kind "VirtualMachine" in version "vm.cluster.gke.io"' error during this step: https://cloud.google.com/anthos/clusters/docs/bare-metal/latest/vm-runtime/windows-vm#create_a_windo...
It appears the apiVersion is missing the version component, for the examples can you please update:
apiVersion: vm.cluster.gke.io
to
apiVersion: vm.cluster.gke.io/v1
Please let me know if that resolves your issue so I can follow-up as needed, and if you are still experiencing issues please include the content of your "windows-vm.yaml".
Thanks!
Andrew_P
hello andrew thanks for the help the kind error was resolved but i an not abel to create a vm though it can you help me out with sample file of config i am attaching below my config
apiVersion: vm.cluster.gke.io/v1
kind: VirtualMachineDisk
metadata:
name: admin-boot-dv
spec:
size: 100Gi
---
apiVersion: vm.cluster.gke.io/v1
kind: VirtualMachine
metadata:
name: admin
spec:
compute:
virtualMachineTypeName: example-machinetype
osType: Windows
disks:
- virtualMachineDiskName: admin-boot-dv
boot: true
- virtualMachineDiskName: windows-iso
- virtualMachineDiskName: virtio-driver
interfaces:
- name: eth0
networkName: pod-network
Hi @chetanchoudhery,
I'm glad to hear that resolved the `kind` error.
For your current issue, can you provide the error message and/or symptoms?
You can use the following command to monitor a VM being created:
kubectl get gvm
While most Virtual Machines come up in under 30 minutes, downloading large VM issues or environments with limited network bandwidth could take longer.
Use the following command to retrieve additional details on a Virtual Machine that continues not to start:
kubectl describe vm <virtualmachinename>
Some common causes of VMs not starting are:
Cheers,
Andrew_P
below is the decription of vm
Name: admin2
Namespace: default
Labels: <none>
Annotations: kubevirt.io/latest-observed-api-version: v1
kubevirt.io/storage-observed-api-version: v1alpha3
API Version: kubevirt.io/v1
Kind: VirtualMachine
Metadata:
Creation Timestamp: 2022-11-21T12:21:23Z
Generation: 1
Managed Fields:
API Version: kubevirt.io/v1alpha3
Fields Type: FieldsV1
fieldsV1:
f:status:
.:
f:conditions:
f:created:
f:printableStatus:
f:volumeSnapshotStatuses:
Manager: Go-http-client
Operation: Update
Time: 2022-11-21T12:21:23Z
API Version: kubevirt.io/v1
Fields Type: FieldsV1
fieldsV1:
f:spec:
.:
f:runStrategy:
f:template:
.:
f:metadata:
.:
f:annotations:
.:
f:networking.gke.io/default-interface:
f:networking.gke.io/interfaces:
f:creationTimestamp:
f:labels:
.:
f:kubevirt/vm:
f:spec:
.:
f:domain:
.:
f:cpu:
.:
f:cores:
f:sockets:
f:threads:
f:devices:
.:
f:disks:
f:interfaces:
f:resources:
.:
f:requests:
.:
f:memory:
f:evictionStrategy:
f:networks:
f:volumes:
Manager: manager
Operation: Update
Time: 2022-11-21T12:21:23Z
Resource Version: 211066
UID: 8feebf41-a545-4a17-9ef0-40cc3dc82379
Spec:
Run Strategy: Always
Template:
Metadata:
Annotations:
networking.gke.io/default-interface: eth0
networking.gke.io/interfaces: [{"interfaceName":"eth0","interface":"admin2-eth0-9a858"}]
Creation Timestamp: <nil>
Labels:
kubevirt/vm: admin2
Spec:
Domain:
Cpu:
Cores: 2
Sockets: 1
Threads: 1
Devices:
Disks:
Disk:
Bus: sata
Name: windows-disk-at
Boot Order: 1
Disk:
Bus: sata
Name: windows-boot-disk
Cdrom:
Bus: sata
Name: kubevm-agent-sa-disk
Serial: agentSADisk
Cdrom:
Bus: sata
Name: kubevm-agent-installation-disk
Serial: agentInstallation
Cdrom:
Bus: sata
Name: kubevm-agent-config-disk
Interfaces:
Mac Address: f8:8f:ca:00:00:01
Masquerade:
Name: eth0
Machine:
Type: q35
Resources:
Requests:
Memory: 4Gi
Eviction Strategy: LiveMigrate
Networks:
Name: eth0
Pod:
Volumes:
Data Volume:
Name: windows-disk-at
Name: windows-disk-at
Data Volume:
Name: windows-boot-disk
Name: windows-boot-disk
Name: kubevm-agent-sa-disk
Service Account:
Service Account Name: admin2-agent-sa
Container Disk:
Image: gcr.io/anthos-baremetal-release/kubevm/kubevm-guest-agent-win:v1.12.4-gke.1
Name: kubevm-agent-installation-disk
Config Map:
Name: admin2-agent-cfg
Volume Label: kubevm-agent-cfg
Name: kubevm-agent-config-disk
Status:
Conditions:
Last Probe Time: 2022-11-21T12:21:23Z
Last Transition Time: 2022-11-21T12:21:23Z
Message: virt-launcher pod has not yet been scheduled
Reason: PodNotExists
Status: False
Type: Ready
Created: true
Printable Status: WaitingForVolumeBinding
Volume Snapshot Statuses:
Enabled: false
Name: windows-disk-at
Reason: No VolumeSnapshotClass: Volume snapshots are not configured for this StorageClass [local-disks] [windows-disk-at]
Enabled: false
Name: windows-boot-disk
Reason: No VolumeSnapshotClass: Volume snapshots are not configured for this StorageClass [local-disks] [windows-boot-disk]
Enabled: false
Name: kubevm-agent-sa-disk
Reason: Snapshot is not supported for this volumeSource type [kubevm-agent-sa-disk]
Enabled: false
Name: kubevm-agent-installation-disk
Reason: Snapshot is not supported for this volumeSource type [kubevm-agent-installation-disk]
Enabled: false
Name: kubevm-agent-config-disk
Reason: Snapshot is not supported for this volumeSource type [kubevm-agent-config-disk]
here is my available resource
Thanks for the `kubectl describe` of the VM that won't start above. I see the status is `WaitingForVolumeBinding`, so I would recommend first checking the status of your storage volumes. Common issues might include an incorrect StorageClass, insufficient available free storage, unable to access a requested image url (e.x. Windows ISO), etc. I would suggest running:
kubectl get dv
That should list your configured VM disks. Any that aren't ready can then be further inspected with:
kubectl describe dv <name>
Cheers,
Andrew_P