When one resource is a parent to another resource, the parent resource must exist before you create the child resource. If the parent resource doesn't exist, you see a ParentResourceNotFound message. If you don't specify a dependency on the parent resource, the child resource might be deployed before the parent.
VMs are child resources under a lab in a resource group. When you use Resource Manager templates to deploy VMs by using PowerShell, the resource group name provided in the PowerShell script should be the resource group name of the lab. For more information, see Troubleshoot common Azure deployment errors.