A method for configuring a fibre channel, FC, storage area network, SAN, comprising: receiving (S201, S401), by a switch, a login request message sent by a first server, and sending (S201, S402) a login response message to the first server, wherein the login response message is used to notify the first server that the switch has successfully received the login request message; and the login request message comprises a first identifier of a first virtual machine, VM, and a world wide group name, WWGN, of a port group of the first VM, the first identifier comprises at least one of a world wide port name, WWPN, of a first N_port of the first VM or an identifier of the first N_port of the first VM, the first N_port is an N_port that is used on the first server by the first VM, and an N_port that is used on any server, of the first VM belongs to the port group of the first VM; wherein the port group comprises a set of WWPNs of one or more N_ports used by the first VM in a life cycle, wherein the life cycle is a migration process, and members in the port group are inaccessible to each other; establishing (S202, S403), by the switch, a correspondence between the first identifier and the WWGN according to the login request message; and sending, by the switch according to a configuration of a first zone, the first identifier and the WWGN to a storage device belonging to the first zone; wherein the configuration of the first zone comprises the WWGN and a WWPN of an N_port of the storage device, and the configuration of the first zone is used to indicate that the first VM corresponding to the WWGN and the storage device belong to the first zone. receiving (S201, S401), by a switch, a login request message sent by a first server, and sending (S201, S402) a login response message to the first server, wherein the login response message is used to notify the first server that the switch has successfully received the login request message; and the login request message comprises a first identifier of a first virtual machine, VM, and a world wide group name, WWGN, of a port group of the first VM, the first identifier comprises at least one of a world wide port name, WWPN, of a first N_port of the first VM or an identifier of the first N_port of the first VM, the first N_port is an N_port that is used on the first server by the first VM, and an N_port that is used on any server, of the first VM belongs to the port group of the first VM; wherein the port group comprises a set of WWPNs of one or more N_ports used by the first VM in a life cycle, wherein the life cycle is a migration process, and members in the port group are inaccessible to each other; establishing (S202, S403), by the switch, a correspondence between the first identifier and the WWGN according to the login request message; and sending, by the switch according to a configuration of a first zone, the first identifier and the WWGN to a storage device belonging to the first zone; wherein the configuration of the first zone comprises the WWGN and a WWPN of an N_port of the storage device, and the configuration of the first zone is used to indicate that the first VM corresponding to the WWGN and the storage device belong to the first zone.