beadm does not recognize the nickname whilst cloning a BE
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.
#2 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.
#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.