A vSphere Distributed Switch cannot be created on an ESXi host directly. You need to be connected to the vCenter Server, either by using the vSphere Client or by using the vSphere Web Client. Also, keep in mind that a dvSwitch can only be created at the data center level in the vCenter inventory.