Set-NTNXcluster showed unexpected behaviour | Nutanix Community
Skip to main content
Hi Folks,



Got something wiered happened today, might be a bug or something.



I was to change current time zone setting by



Get-NTNXCluster | Set-NTNXCluster -Timezone "Australia/Sydney"



However it throw me an error:



"The cluster name may contain only English letters, decimal digits (0-9), dots, hyphens and underscores. Set-NTNXCluster : The remote server returned an error: (500) Internal Server Error."



Then I thought it might be because I did not include cluster id, so I ran below command :



Get-NTNXContainer -Id xxxxxxx-xxxxxxx-xxxxxx-xxxxxx-xxxxxxxxxxxxxx::4769 | Set-NTNXCluster -Timezone "Australia/Sydney"



Apprently you will find instead of using Get-NTNXCluster, I used Get-NTNXContainer which I copied from command I previously ran without double check, you would assume that will throw me an error, but it did not, it finished with a "Success".



Yes, it did change the timezone on the cluster, however at the same time it changed cluster name to the Container name as well which is totally unexpected.



So I thought I might be able to change it back to the original cluster name with a space in middle by run this command :



Get-NTNXCluster -Id xxxxxxx-xxxxxxx-xxxxxx-xxxxxx-xxxxxxxxxxxxxx | Set-NTNXCluster -Name "My Cluster 1"



Again, it throw me an error like the one above, so I have to change the name to "My-Cluster-1", then it worked.



I know this is not a big issue, but it will be good to have some sort of explaination, and get rid of those hypens from my cluster name.



Cheers!
By the way I am on version 4.5.2.1
Just read some post in forum about timezone setting, and before I ran into this, i also tried :



cluster set-timezone timezone=Australia/Sydney



It complained about the special characters as well.
Hi - pls see inline below ....
PVniverse wrote:
I was to change current time zone setting by

Get-NTNXCluster | Set-NTNXCluster -Timezone "Australia/Sydney"



> this is a pipeline cmd, the output of the get cluster is the input to the set cluster cmdlet

> the error is telling you that the name it retrieves is invalid (we see below that it contains

> spaces). Also you may need to escape the "/" in the timezone parameter as follows :

> Australia/Sydney as per std shell syntax.



However it throw me an error:



"The cluster name may contain only English letters, decimal digits (0-9), dots, hyphens and underscores. Set-NTNXCluster : The remote server returned an error: (500) Internal Server Error."



Then I thought it might be because I did not include cluster id, so I ran below command :



Get-NTNXContainer -Id xxxxxxx-xxxxxxx-xxxxxx-xxxxxx-xxxxxxxxxxxxxx::4769 | Set-NTNXCluster -Timezone "Australia/Sydney"



Apprently you will find instead of using Get-NTNXCluster, I used Get-NTNXContainer which I copied from command I previously ran without double check, you would assume that will throw me an error, but it did not, it finished with a "Success".



> so the set cluster cmdlet used the output from get container cmdlet and converted that into a > cluster name. I suspect that's the bug here maybe?



Yes, it did change the timezone on the cluster, however at the same time it changed cluster name to the Container name as well which is totally unexpected.



So I thought I might be able to change it back to the original cluster name with a space in middle by run this command :



Get-NTNXCluster -Id xxxxxxx-xxxxxxx-xxxxxx-xxxxxx-xxxxxxxxxxxxxx | Set-NTNXCluster -Name "My Cluster 1"



> I think its because you are using white space in the cluster name - using the hyphens below

> works as you have seen





Again, it throw me an error like the one above, so I have to change the name to "My-Cluster-1", then it worked.



I know this is not a big issue, but it will be good to have some sort of explaination, and get rid of those hypens from my cluster name.



> I would open a case with support to look at how the parameters are set in the set cluster timezone cmdlet. Might need stricter syntax checking ?



Thanks
ray

Yea, if you could open a support ticket, we'd appreciate it.
Thanks Ray for the prompt reply, i will raise a ticket.