So is this a bona fide bug, or does the documentation need to be changed to indicate that default_dispvm cannot be set to ‘default’ in qvm.prefs? (Right now it says you can set a property to ‘default’, with the implication being that it can be any property. )
I know it’s true in many cases, but I haven’t checked all possibilities. I wouldn’t be surprised if the rule is that ‘default’ is allowed except for properties that are the names of VMs. Incidentally the error message indicated that ‘none’ also isn’t allowed, but in this particular case, it is. ‘none’ certainly should be forbidden for the template property!
This is less of a problem if creating a qube de novo, because simply not setting the property at all will leave it as the default. It’s more of an issue if trying to modify an existing VM that has the property set to something (even something that happens to match the default, for the moment). At that point it’s hard to tell it; “use whatever the default is” though of course there is the rather clunky work-around.
This may sound like a contrived example, but I ran into it when rebuilding the actual default dispvm template. It’s easy enough to just set the global default to something else temporarily while deleting-and-rebuilding-and-configuring, but if some VM explicitly names that qube as its default dispvm there will be trouble (or a lot of work looping through every qube to change its default-dispvm then switch it back afterwards).
No, I wasn’t using --default. (That’s what you have to do on the command line qvm-prefs, but I wasn’t trying to do that in the qvm.prefs salt state.) The docs said I had to use default without the double dash in salt, and that’s exactly what I did. It threw an error, telling me I wasn’t allowed to use either default or none. (In fact, it will let me use none.)
I had no idea until I read what you wrote, that I was supposed to use *default*with asterisks. And the doc doesn’t say that I should, it simply says ‘default.’
Anyhow, the ‘with asterisks’ works (and I don’t need the single quotes).
My previous reply didn’t show as a reply TO YOU, so I am repeating it here, with a correction:
WHOA…
No, I wasn’t using --default. (That’s what you have to do on the command line qvm-prefs, but I wasn’t trying to do that in the qvm.prefs salt state.) The docs said I had to use default without the double dash in salt, and that’s exactly what I did. It threw an error, telling me I wasn’t allowed to use either default or none. (In fact, it will let me use none.)
I had no idea until I read what you wrote, that I was supposed to use *default*with asterisks. And the doc doesn’t say that I should, it simply says ‘default.’
Correction, I DO need the single quotes. So to set to default, don’t use default but rather '*default*'
The text of the doc shows default (but without single quotes) but the actual example salt code does not show asterisks in the one place default is used (nor does it use the single quotes).
In fact, you need single quotes around it. Unman indicates this, the docs do not.
Also the example in the docs doesn’t have either asterisks or single quotes, around the one “default” it shows. I was reading that thinking it was correct and perhaps thought the asterisks in the text were for emphasis (just like you thought Unman’s were). Or maybe I never noticed them at all; it was a few days ago and I don’t remember. Either way, I think the docs could stand some clarification.
I suggest that right after '*default*' in the text, it should state “(note that the asterisks and single quotes are required)” and of course put the asterisks and single quotes into the example.