The error you got is because the ssh session lands on a non-principal switch due to some principal switchover event, such as previous principal node had failed and switch to the other node. So your ssh to the management IP of the principal (previous principal) and it is no longer the principal switch for entering configuration. You can double check with sh vcs before enter in configuration mode to avoid the error msg.
As mentioned by Sargis, you take advantage of the "vcs virtual-ip" feature.
The virtual IP address should be configured on the same subnet as the management interface IP
address. It should not be a duplicate to any management IP addresses of the switches in the VCS cluster.
When the virtual IP address is configured, at principal switch, for the first time, the address is assigned to the
principal switch in global mode. You can then access the principal switch through the management port IP address or the virtual IP address. The virtual IP configuration is global in nature. All the nodes in the fabric will be configured with the same virtual IP address, but the address is always bound to the current Principal
switch.
Thus, if you ssh to this vcs virtual-ip, it guarantees that you land on the principal node to do your management of the VCS cluster.