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

cannot create new Virtual Machine within a Cluster #10517

Closed
fabricat opened this issue Sep 30, 2022 · 6 comments
Closed

cannot create new Virtual Machine within a Cluster #10517

fabricat opened this issue Sep 30, 2022 · 6 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@fabricat
Copy link

fabricat commented Sep 30, 2022

NetBox version

v3.3.3

Python version

3.9

Steps to Reproduce

  1. select Organization > Sites > ➕ Add
  2. set field Name = "site1"
  3. click Create
  4. select Virtualization > Cluster Types > ➕ Add
  5. set field Name = "type1"
  6. click Create
  7. select Virtualization > Clusters > ➕ Add
  8. set field Name = "cluster1"
  9. set field Type = "type1"
  10. set field Site = "site1"
  11. click Create
  12. select Virtualization > Virtual Machines > ➕ Add
  13. set field Name = "vm1"
  14. set field Cluster = "cluster1"
  15. leave the Site field empty
  16. click Create

Expected Behavior

A new VM "vm1" should be created and associated with the selected Cluster "cluster1".

Observed Behavior

The VM is not created and the following error appears:

The selected cluster (cluster1 is not assigned to this site (None).

(Note: there is also a missing closed parenthesis in the error message)

If I create the VM selecting a Cluster and also a Site, the operation is successful.
This is probably related with #5303

@fabricat fabricat added the type: bug A confirmed report of unexpected behavior in the application label Sep 30, 2022
@kkthxbye-code
Copy link
Contributor

Please change the topic title to something more descriptive. Also please revise your reproduction steps to include all replication steps, including the creation of the cluster. With the current steps it is not reproducible.

@kkthxbye-code kkthxbye-code added the status: revisions needed This issue requires additional information to be actionable label Sep 30, 2022
@fabricat fabricat changed the title New Virtual Machines cannot cannot create new Virtual Machine within a Cluster Sep 30, 2022
@fabricat
Copy link
Author

Hi @kkthxbye-code
Sorry for the wrong title: I have now amended it, together with the reproduction steps.
I hope it is all clear now.

@jeremystretch
Copy link
Member

I'm not able to reproduce the reported behavior on either v3.3.3 or v3.3.4; the virtual machine is created successfully as expected.

@fabricat
Copy link
Author

fabricat commented Oct 3, 2022

Hi @jeremystretch
sorry, I missed an additional detail (which seems fundamental for bug repoduction): the Cluster must be associated with a Site.

I have now amended (and tested) the Steps to reproduce 👍

@jeremystretch jeremystretch removed the status: revisions needed This issue requires additional information to be actionable label Oct 3, 2022
@jeremystretch
Copy link
Member

This is happening because you're attempting to create a VM assigned to a cluster within a site without also assigning the VM to that site, which would be invalid. We can relax the form a bit to automatically assign the site when none is selected, but I want to be clear that the validation is working as expected.

@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Oct 3, 2022
@jeremystretch jeremystretch self-assigned this Oct 3, 2022
@fabricat
Copy link
Author

fabricat commented Oct 4, 2022

Thank you.
Actually, I imagined that was probably the expected behaviour, but looking at docs and error messages I did only see that you must specify a site or a cluster.
I totally agree that when you only specify a cluster, then the site should be inherited.
For my integration/automation tool, retrieving the cluster site is an additional overhead.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants