In the cloud computing environment, files are duplicated into several copies for storage at different locations to increase their access efficiency and fault tolerance. However, there may exist malicious processors in the cloud computing environment. How to ensure that fault-free processors coordinate to find appropriate locations to store these duplicated files without influence from malicious processors is an important issue. In this paper, we propose a consensus algorithm to assist fault-free processors in reaching a consensus on where to store the duplicated files in the presence of malicious processors. In this paper, we will extend the classical consensus problem to a new type of consensus problem called the k-Set consensus problem with weight consideration (k-SetW problem). This problem is integrated with the concepts of weight and k-Set. In other words, each processor in this problem is allowed to have multiple initial values (i.e., the expected locations for the duplicated files) and set the weight for each initial value. The weighted value shows the processor’s preference for an initial value. Regarding the consensus, this problem does not require agreement among all fault-free processors on a single consensus value. It allows coexistence of multiple consensus values as long as the number of consensus values is not greater than k (i.e., the maximum number of duplicated files). By solving the k-SetW problem, we can help fault-free processors determine the locations for storing the duplicates of at most k copies based on their preferences in the presence of malicious processors.