1. A control apparatus, comprising:a memory storing instructions; and
a processor configured to execute program instructions to:
detect, based on an analysis of an identifier of a packet transmitted from a first virtual machine, that the first virtual machine has been connected to a first tunnel endpoint which functions as an endpoint of a virtual tunnel;
determine a virtual network including whether the first virtual machine belongs to the virtual network based on information in which virtual machines and the virtual network are associated with each other; and
set connection between the first tunnel endpoint and the determined virtual network when the first tunnel endpoint has not joined in the determined virtual network,
wherein the virtual tunnel is used for communicating between the first virtual machine and a second virtual machine connected to a second tunnel endpoint, through the determined virtual network, the first tunnel endpoint being opposite to the second tunnel endpoint, and
wherein the first virtual machine and the second virtual machine belong to the determined virtual network.