Fix vm create in vnet without affinity group

When creating a vm in a virtual network, we would fail if the virtual
network was not associated with any affinity groups.