Skip to content

vic-machine-{os} delete fails to cleanup properly if there are pulled images #7359

@isyarov

Description

@isyarov

vic-machine-{os} delete fails to cleanup properly if there are pulled images.

The container VMs and volumes are removed, but the images are not deleted and the respective folder on the datastore remains. All files related to the VCH deployment are also not cleaned up.
If the VCH is created and deleted without pulling any images, everything is cleaned up properly.
The delete commad output is normal, but running it with the --debug 3 option produces:

DEBU[0013] Failed to delete "[datastore0] virtual-container-host/VIC": Cannot delete file [datastore0] virtual-container-host/VIC
DEBU[0017] Image store parent directory not empty, leaving in place.

This happens if the VCH is created on a vCenter server, i have not tried it on just an ESX.
Trying to delete the folder from the vSphere web client manually fails with:
"Cannot delete file [datastore0] virtual-container-host"
All other files related to the VCH can be deleted, but the image files cannot.
SSH-ing to the ESX and deleting the folder manually succeeds

The vic-machine version is: v1.4.0-dev-0-8d92ff7

Steps to reproduce:

  1. Create a VCH in a vCenter server. I used the following command:
./vic-machine-linux create --target {vcenter-ip} --user {username} --password {password} --bridge-network vch-bridge --image-store datastore0 --volume-store datastore0/vol
umes:default --no-tlsverify --thumbprint {vcenter-cert-thumbprint} --name virtual-container-host
  1. With a docker client execute:
docker --tls -H {VCH-IP}:2376 pull alpine
  1. Delete the VCH. I used the following command:
./vic-machine-linux delete --target {vcenter-ip} --user {username} --password {password} --force --name virtual-container-host

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions