The createPolicy parameter is used to create a policy.
./wpfadmin createPolicy /Policy1.properties
CoreGroupName = DefaultCoreGroup PolicyType = OneOfNPolicy PolicyName = Policy1 PolicyDescription = Policy for partitions1-10 IsAlivePeriodSec = 120 QuorumEnabled = false NumOfMatchCriteria = 2 Name_0 = -gt Value_0 = -p Name_1 = -pc Value_1 = class1 Failback = true PreferredOnly = true NodeName_0 = NodeA ServerName_0 = Server1 NodeName_1 = NodeA ServerName_1 = BackupServer1
CoreGroupName = DefaultCoreGroup PolicyType = OneOfNPolicy PolicyName = Policy2 PolicyDescription = Policy for partitions11-20 IsAlivePeriodSec = 120 QuorumEnabled = false NumOfMatchCriteria = 2 Name_0 = -gt Value_0 = -p Name_1 = -pc Value_1 = class2 Failback = true PreferredOnly = true NodeName_0 = NodeB ServerName_0 = Server2 NodeName_1 = NodeB ServerName_1 = BackupServer2
CoreGroupName = DefaultCoreGroup PolicyType = OneOfNPolicy PolicyName = Policy3 PolicyDescription = Policy for partitions21-30 IsAlivePeriodSec = 120 QuorumEnabled = false NumOfMatchCriteria = 2 Name_0 = -gt Value_0 = -p Name_1 = -pc Value_1 = class3 Failback = true PreferredOnly = true NodeName_0 = NodeC ServerName_0 = Server3 NodeName_1 = NodeC ServerName_1 = BackupServer3
CoreGroupName = DefaultCoreGroup PolicyType = OneOfNPolicy PolicyName = Policy4 PolicyDescription = Policy for partitions31-40 IsAlivePeriodSec = 120 QuorumEnabled = false NumOfMatchCriteria = 2 Name_0 = -gt Value_0 = -p Name_1 = -pc Value_1 = class4 Failback = true PreferredOnly = true NodeName_0 = NodeD ServerName_0 = Server4 NodeName_1 = NodeD ServerName_1 = BackupServer4
Now the core group is set up with the four policies. Start the node agents on nodes A-D. After a short interval, the core group changes are synchronized to all the nodes. Assuming that the application is already installed, when Server1 is started partitions1-10 are activated on Server1 because Policy1 has the preferredOnly value set to true Partitions1-10 can only be started on Server1 and BackupServer1. If BackupServer1 is started before Server1, partitions1-10 are activated on BackupServer1. If neither Server1 or BackupServer1 are started, the partitions are not activated.
This situation explains how the preferredOnly and preferred servers work. When the failback option is set to true, the partitions for the policy are always activated on the preferred server. If partitions1-10 are active on Server1, then Server1 goes down, the partitions activate on BackupServer1. If in the future Server1 comes up, the partitions go back to Server1, because this server is first in the preferred server list.