Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1305747 - Cannot dis-associate a Subnet from a Domain using Hammer
Summary: Cannot dis-associate a Subnet from a Domain using Hammer
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.6
Hardware: All
OS: Linux
high
medium
Target Milestone: Unspecified
Assignee: Rahul Bajaj
QA Contact: Katello QA List
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-09 06:10 UTC by anerurka
Modified: 2020-05-14 15:06 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-05 14:10:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 13994 0 Normal Closed Cannot dis-associate a Subnet from a Domain using Hammer 2020-02-15 01:13:41 UTC

Description anerurka 2016-02-09 06:10:32 UTC
Description of problem:

Cannot dis-associate a Subnet from a Domain using Hammer.

- Due to which can not delete a Subnet using hammer command

Version-Release number of selected component (if applicable):

Satellite Server v.6.1.6

How reproducible:

Steps to Reproduce:

1. Create a Domain and Subnet using hammer command:

# hammer domain create --name "test-domain"
Domain [test-domain] created

# hammer subnet create --name "test" --network "x.x.x.x" --mask "255.255.255.0" --domains "test-domain"
Subnet created

2. Try deleting the subnet and it will fail with the below error :

# hammer subnet delete --name "test"
Could not delete the subnet:
  test (x.x.x.x/24) is used by test-domain

# hammer domain delete --name "test-domain"
Could not delete the domain:
  test-domain is used by test (x.x.x.x/24)


Actual results:

Could not delete the subnet:
  test (x.x.x.x/24) is used by test-domain

Expected results:

Subnet Deleted successfully

Additional info:

It is due to the association created between the Subnet and the Domain.

If a Subnet is created without the Domain association, then it is deleted successfully.

Currently we can remove the association manually over the Satellite Server Web UI

--> log in to Satellite --> Infrastructure --> Subnet --> Select the Subnet "test" --> Domains --> Remove the check mark from "test-domain" --> Submit

# hammer subnet delete --name "test"

- Below Hammer command does not remove the association using hammer command:

# hammer subnet update --domains "" --name "test"  ---> Rather it associates the Subnet with all the Domain's.

Comment 2 Brad Buckingham 2016-03-01 20:16:11 UTC
Created redmine issue http://projects.theforeman.org/issues/13994 from this bug

Comment 3 Bryan Kearney 2016-03-01 21:07:00 UTC
Upstream bug component is Provisioning

Comment 4 Bryan Kearney 2016-03-02 09:06:56 UTC
Upstream bug component is Hammer

Comment 5 Brad Buckingham 2016-03-02 11:04:12 UTC
Upstream redmine comment:

hammer subnet update --domain-ids '' works fine.

Comment 9 Rahul Bajaj 2018-07-05 14:10:34 UTC
hello,

This is the expected behavior of subnet. If a subnet is associated with a 
domain then you cannot delete the same.

To dis-associate a subnet from a domain, you might want to do something like:

$ hammer subnet update --id '3' --domains ""

$ hammer subnet delete --id '3'

Basically you can disassociate a subnet form a domain by passing "" value.

I am closing this issue as `NOTABUG`. Feel free to open it, if you feel I am missing something.

Comment 10 Anand Agrawal 2018-07-24 10:20:38 UTC
@Rahul Bajaj,

In Red Hat Satellite 6.2.12 following hammer command did not work as expected.

$ hammer subnet update --id '3' --domains ""

Instead of disassociating the subnet from the domain, it would associate subnet to all available domains.

However, I can check in Red Hat Satellite and it is working as per expectation.

Regards,
Anand


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