Project

General

Profile

Bug #9797

beadm does not recognize the nickname whilst cloning a BE

Added by Suraj Ravichandran over 5 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Important
Assignee:
Sean Fagan
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

To Reproduce this problem as well as explain myself, I will directly specify the reproduction steps:

1. Rename any given BE to have a nickname other than the original BE name, for example beadm rename FreeNAS-9.3-Nightlies-201505140630 surajfix
2. Try to clone this BE with beadm create -e surajfix somerandomnewclonename

Step 2 gives the following error:
[root@freenas] ~# beadm create -e surajfix somerandomnewclonename
ERROR: Boot environment 'surajfix' does not exist

This is needed by the gui as a user can easily rename the current BE and then one day go ahead and update the box but the update would fail.

Associated revisions

Revision 1148a504 (diff)
Added by Sean Fagan over 5 years ago

"beadm -e <name>" doesn't look at nicknames, so we have to use the real name. Fortunately, the only time -e was used was CreateClone, and the only time it was done was when the GUI was used to clone an existing boot environment, and the only time it mattered was when the source BE had been renamed at some point. Changed a bit of the GUI with William's advice. Ticket: #9797 Merge-FN93: Yes Merge-TN93: Yes

Revision f6fff253 (diff)
Added by Sean Fagan over 5 years ago

"beadm -e <name>" doesn't look at nicknames, so we have to use the real name. Fortunately, the only time -e was used was CreateClone, and the only time it was done was when the GUI was used to clone an existing boot environment, and the only time it mattered was when the source BE had been renamed at some point. Changed a bit of the GUI with William's advice. Ticket: #9797 Merge-FN93: Yes Merge-TN93: Yes (cherry picked from commit 1148a5041184e69cb9fb8e167e3e208afaa5a2b1)

Revision b10537da (diff)
Added by Sean Fagan over 5 years ago

"beadm -e <name>" doesn't look at nicknames, so we have to use the real name. Fortunately, the only time -e was used was CreateClone, and the only time it was done was when the GUI was used to clone an existing boot environment, and the only time it mattered was when the source BE had been renamed at some point. Changed a bit of the GUI with William's advice. Ticket: #9797 Merge-FN93: Yes Merge-TN93: Yes (cherry picked from commit 1148a5041184e69cb9fb8e167e3e208afaa5a2b1) Former-commit-id: f6fff253bf522b52fe057dca0c832889894b49da

Revision 8561eddc (diff)
Added by Sean Fagan about 5 years ago

"beadm -e <name>" doesn't look at nicknames, so we have to use the real name. Fortunately, the only time -e was used was CreateClone, and the only time it was done was when the GUI was used to clone an existing boot environment, and the only time it mattered was when the source BE had been renamed at some point. Changed a bit of the GUI with William's advice. Ticket: #9797 Merge-FN93: Yes Merge-TN93: Yes (cherry picked from commit 1148a5041184e69cb9fb8e167e3e208afaa5a2b1)

Revision 3def4560 (diff)
Added by Sean Fagan about 5 years ago

"beadm -e <name>" doesn't look at nicknames, so we have to use the real name. Fortunately, the only time -e was used was CreateClone, and the only time it was done was when the GUI was used to clone an existing boot environment, and the only time it mattered was when the source BE had been renamed at some point. Changed a bit of the GUI with William's advice. Ticket: #9797 Merge-FN93: Yes Merge-TN93: Yes (cherry picked from commit 1148a5041184e69cb9fb8e167e3e208afaa5a2b1)

History

#1 Updated by Sean Fagan over 5 years ago

The update code just does "beadm create <newname>"; the GUI code to rename a BE, however, uses "-e", and it uses the nickname.

#2 Avatar?id=14398&size=24x24 Updated by Kris Moore over 5 years ago

  • Status changed from Unscreened to Screened

Yes, the -e flag to create expects a dataset name, not the nickname. I could add another flag to indicate that it is a nickname you are working on, instead of dataset name though. Probably a (-E)

However, if you are wanting to do is "rename" the nickname, this can be done with "beadm rename -n <oldnick> <newnick>"

#3 Updated by Sean Fagan over 5 years ago

Remember this is all being done from python scripts, and most of our installed base is installed off of very slow thumb drives. So running beadm in a subprocess multiple times is very slow and error prone.

Given all that, and the fact that everything else defaults to using the nickname rather than the real name, why is -e different?

I could assume that the name is a nickname, but if the BE doesn't have a nickname, I don't know that. In which case having a flag that says "this is a nickname, use it for creating" would then fail.

In fact, it doesn't look like there is any way to create a new BE from a nickname. Unless I'm reading the code incorrectly.

#4 Updated by Sean Fagan over 5 years ago

So I can work around it, I think, but it also requires a change to the GUi part so let me send some email to William.

#5 Updated by Sean Fagan over 5 years ago

  • Status changed from Screened to Ready For Release
  • Assignee changed from Kris Moore to Sean Fagan
  • ChangeLog Entry updated (diff)

So, I worked around it in 1148a5041184e69cb9fb8e167e3e208afaa5a2b1 which means I'll be taking this.

I am not too happy with it, because it will increase time, but "beadm list" is much faster than any of the writing operations.

#6 Updated by Jordan Hubbard over 5 years ago

  • Status changed from Ready For Release to Resolved

#7 Avatar?id=14398&size=24x24 Updated by Kris Moore about 4 years ago

  • Seen in changed from Unspecified to N/A

#8 Avatar?id=14398&size=24x24 Updated by Kris Moore about 4 years ago

  • Target version changed from Unspecified to N/A

Also available in: Atom PDF