Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not be allowed to remove "default" storagepool and network #265

Open
Truja opened this issue Dec 11, 2013 · 14 comments
Open

Should not be allowed to remove "default" storagepool and network #265

Truja opened this issue Dec 11, 2013 · 14 comments
Milestone

Comments

@Truja
Copy link
Contributor

Truja commented Dec 11, 2013

Currently, it is possible to remove "default storagepool" and "default network".

But, those come back next time Kimchi runs and libvirt gives error like:
""" libvir: Network Driver error : Network not found: no network with matching name 'default' """

@sming56
Copy link

sming56 commented Dec 11, 2013

I think we should not allow the network or storage to be removed if there is any VM or template depending on it. That is definitely a bug.

@lvroyce
Copy link
Contributor

lvroyce commented Dec 11, 2013

I think since all our vm depends on default pool and network, we may prefer not to deactive and delete them.
I agree with ming that for other pools and networks we need to check the dependency.
We had discussed in mailist about introduce a ref count for storage pool. We can get this ref count from querying libvirt and caculating it or by storing it into db. Personally I tend to query with libvirt and caculating ref. Also @shaohef will introduce vms list which are attached to network list.

@Truja
Copy link
Contributor Author

Truja commented Dec 11, 2013

Yes, I found a lot of dependency problems while testing yesterday. I am going to open bugs or send fixes.

@shaohef shaohef self-assigned this Feb 20, 2014
@shaohef
Copy link

shaohef commented Feb 20, 2014

@Truja
db954e9 do not allow the network to be removed if there is any VM or template depending on it.
for storagepool
another patch will send out later.

@cd1
Copy link
Member

cd1 commented Feb 26, 2014

This issue is about not being allowed to remove the storage pool and network named "default", regardless of whether they are being used or not. Is this actually a problem? Are those elements special to Kimchi so we should not allow them do be deleted? If not, we should close this issue.

The patch mentioned above does not allow removing a storage pool or network which is being used by some template/VM, regardless of their names. That fixes a different problem (the one that @sming56 described in his comment), not this one.

@shaohef
Copy link

shaohef commented Feb 27, 2014

I think we can remove the "default" safely. if no template or vms use it.
if user need it, user can create a new "default" network.
Actually, if no "default" network, kimchi will create one with a fixed IP address.
There may be a conflict is some scenarios. such as in nested KVM
This can be fixed by:

  1. delete the "default" network and create a new one at present.
  2. edit the "default" network, if we do not want to remove the "default".
    But 2 is not support at present. so any IP conflict, user can use other tools such as virsh, virt-manager to solve this problem. for other tools can delete the "default" network.

for the default storage pool there is also the similar problem.
the pool path is in /var/lib, if its space is not big enough, the user will need to delete and create a new one, or edit this one.

so I prefer we could allow to delete them safely as commit db954e9

@cd1 what about you?

@Truja
Copy link
Contributor Author

Truja commented Feb 27, 2014

Actually, my point in this bug is: why remove default storagepool and/or default network if they are going to be recreated every time Kimchis restart ?

If you make a test: remove both 'defaults' and then restart Kimchi. They will be there again.
So, why remove ? Or, does not recreate them in Kimchi start, or recreate only if no other pool/network exist.

@Truja
Copy link
Contributor Author

Truja commented Feb 27, 2014

Please, see also the problem in #302

@shaohef
Copy link

shaohef commented Mar 7, 2014

patch submit to fix #302

For this issue:
if all agree that kimchi should not be allowed to remove "default" storagepool and network
I will send a patch to fix this one.

@sming56
Copy link

sming56 commented Mar 7, 2014

In my opinion, we should have ways to mark all the storagepools and networks created by Kimchi. And only the storagepools and networks created by Kimchi can be removed by Kimchi.

@cd1
Copy link
Member

cd1 commented Mar 7, 2014

I don't think so. What if a user migrates to Kimchi? They will not be able to interact with what they have created before, and that does not make sense.

@alinefm
Copy link
Member

alinefm commented Mar 7, 2014

I made some comments on #302 which applies to this issue too.
#302 (comment)

So yes, default network/storage pool can be deleted if any vms or template is associated to them.
The problem is kimchi always create those resources on start up.

It should be done by libvirt not by kimchi

@alinefm
Copy link
Member

alinefm commented Mar 7, 2014

I thought more about that and while creating a template user only provides the ISO file and all other configuration is provided by kimchi.
Which means we will always set the default network and storage pool for a new template.

So yes, those resources should not be deactivated or removed otherwise we will create inconsistent templates from the scratch

@alinefm
Copy link
Member

alinefm commented Mar 13, 2014

Network fixed in e6806e4

@alinefm alinefm added this to the 1.2.1 GA milestone Apr 1, 2014
@alinefm alinefm removed this from the 1.2.1 GA milestone Jul 2, 2014
@alinefm alinefm added this to the Backlog milestone Dec 3, 2014
@alinefm alinefm added enhancement and removed bug labels Dec 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants