Bug 1615730 - VirtualMachineReplicaSet does not delete finished VMs
Summary: VirtualMachineReplicaSet does not delete finished VMs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 1.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 1.3
Assignee: Roman Mohr
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-14 06:43 UTC by Guohua Ouyang
Modified: 2019-01-15 14:05 UTC (History)
6 users (show)

Fixed In Version: kubevirt-0.9.4-2.gd763ed8.6e00282 cnv-libvirt-container-v1.3.0-3 virt-api-container-v1.3.0-11 virt-controller-container-v1.3.0-13 virt-handler-container-v1.3.0-12 virt-launcher-container-v1.3.0-13
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-15 14:05:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 4 Roman Mohr 2018-09-18 08:04:44 UTC
That's fixed here: https://github.com/kubevirt/kubevirt/pull/1237

Comment 8 Israel Pinto 2018-11-12 12:54:16 UTC
Verify with:
virtctl version
Client Version: version.Info{GitVersion:"v0.9.4", GitCommit:"6e0028292ab269f4b4b5d98b1870ca5b84a47b10", GitTreeState:"clean", BuildDate:"2018-11-07T17:08:16Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{GitVersion:"v1.3.0-11-1-g3f367f7", GitCommit:"78435f76c79c97c4491fd7c0549744633c98a53d", GitTreeState:"clean", BuildDate:"2018-11-08T14:55:47Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}


Steps:
1. oc create -f replicaset.yaml                                                  
output: virtualmachineinstancereplicaset.kubevirt.io/vmi-replicaset-fedora created
2. oc adm drain cnv-executor-ipinto-node1.example.com --delete-local-data --ignore-daemonsets=true --force --pod-selector=kubevirt.io=virt-launcher                     
output:
node/cnv-executor-ipinto-node1.example.com cordoned
WARNING: Deleting pods with local storage: virt-launcher-vmi-replicaset-fedoramsgxc-lhvsk, virt-launcher-vmi-replicaset-fedorazwtnx-fqwsx; Deleting pods not managed by ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet: virt-launcher-vmi-replicaset-fedoramsgxc-lhvsk, virt-launcher-vmi-replicaset-fedorazwtnx-fqwsx
pod/virt-launcher-vmi-replicaset-fedorazwtnx-fqwsx evicted
pod/virt-launcher-vmi-replicaset-fedoramsgxc-lhvsk evicted
3. oc get vmi                                                                                                                                                           
output: 3 vmi-replicaset
NAME                         AGE
test-cache                   2d
vmi-replicaset-fedorafnzxl   9s
vmi-replicaset-fedoral69fn   9s
vmi-replicaset-fedoravmvl8   2m
4. oc delete -f replicaset.yaml                                                
output:
virtualmachineinstancereplicaset.kubevirt.io "vmi-replicaset-fedora" deleted



used yaml:

apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachineInstanceReplicaSet
metadata:
  creationTimestamp: null
  name: vmi-replicaset-fedora
spec:
  replicas: 3
  selector:
    matchLabels:
      kubevirt.io/vmReplicaSet: vmi-replicaset-fedora
  template:
    metadata:
      creationTimestamp: null
      labels:
        kubevirt.io/vmReplicaSet: vmi-replicaset-fedora
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: registrydisk
            volumeName: registryvolume
        machine:
          type: ""
        resources:
          requests:
            memory: 512M
      terminationGracePeriodSeconds: 0
      volumes:
      - name: registryvolume
        registryDisk:
          image: kubevirt/fedora-cloud-registry-disk-demo:latest
status: {}


Note You need to log in before you can comment on or make changes to this bug.