def set_vnic_connectivity_status(nic_spec, to_connect):
        """
            sets the device spec as connected or disconnected
            :param nic_spec: the specification
            :param to_connect: bool
            """
        nic_spec.device.connectable = vim.vm.device.VirtualDevice.ConnectInfo()
        nic_spec.device.connectable.connected = to_connect
        nic_spec.device.connectable.startConnected = to_connect