Embodiments generally relate to a method and device of determining a location of a server in a data center by establishing a relationship between a rack unit where each server of the data center is located and a port of a switch and determining the rack unit where the server is located based on a port of a switch connected to the server and the established relationship, and determining a location of the rack unit where the server is located based on relative positions of the switch connected to the server and a plurality of reference points.