-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmware_guest: Deploy from template receives Error. #28649
Comments
It seems to be access related. I wonder if your user has the required permissions for what you want to do. |
@dagwieers I don't see any access-related events in vCenter, in-fact the error is being taken from the vCenter. I only see the same error in vCenter too. [ Unable to access the virtual machine configuration: Unable to access file [xio-mgmt-lun02] Test_Templatecentos7/Test_Templatecentos7.vmtx ] I used the same credentials in Ansible as well as in PowerCLi. Admin is the only user in my vCenter and is the root user.
|
Any Update on this??? @dagwieers @Akasurde |
Is the shared storage accessible to both clusters? I've run into a similar issue to this. The module attempts to clone the VM to the first sorted host in the cluster. If the host doesn't have access to the data store with the template on it, you'll get a similar error. |
@dav1x I am not sure how to validate what you said from the ansible/pyvmomi perspective. The storage that I have is Xtrem IO LUNs. If I have the accessibility issues, then I should get the same error when manually deploy a VM from the template, correct? (But that is not the case here, I could deploy VM into another cluster from vcenter and powercli) |
Not necessarily. Does each cluster have access to all of the LUNs in question? Specifically from your error message: Does the first host sorted in vCenter client in cluster az2 have access to xio-mgmt-lun02? |
Thanks for your reply @dav1x . I appreciate your time on this.
I am a bit confused here, when you said host should have access to mgmt-lun i.e, the host is trying to read the template for VM creation. Wouldn't that be handled by the Vcenter itself when cloning/copying the VMs/Templates from one LUN to another LUN. Also, I see this problem only when using Vsphere Python SDK/Ansbile Modules. How can PowerCLI core is handling it gracefully? Any explanation is appreciated. |
By default the datastore vmware_guest uses is located via the location of the template. You should be able to specify a destination datastore under disks. Like this:
This should circumvent the datastore check and prompt vmware_guest to use the datastore in question. To answer your question, yes, I think the check for the datastore should be initiated by the host or cluster specified and not the vm object(template) in question. For your immediate use, the above should get around the issue for you. |
I tried and still have the same issue.
|
Let me try to recreate this. I'm successfully able to clone a template from the same cluster to a specified datastore. I'm thinking that may be the root cause to your issue. |
Yeah, please. I did mentioned that in my issue discription. The issue is only when I try to deploy it across the clusters. If I have the template in same cluster then no problems. However, this is really not the practical scenario. Assume that you just created a cluster and added hosts to it. I am unnecessarily creating a copy of existing template if I have to copy that template to the newly added cluster. Assume if I have N templates. |
I have a 2 host cluster right now. I pulled a host from my cluster and created a new cluster. I dismounted my templates datastore where I have my templates. I can clone across clusters provided I specify disk options.
Can you post your playbook with the added disk list? |
I have the playbook written as below : If you are free and available, I can show you a demo over WebEx ( I mean If you are really free!).
|
Sure. I've got an hour before my next session. Send me an invite via email - davis.phillips@gmail.com Thanks! |
Just to recap the webex, the root cause was the usage of a datastore cluster instead of the datastore name. I'll create a new issue for a feature request for datastore cluster support. Glad I could help out! |
Thanks a lot @dav1x for your time. Could you please also add the Folder functionality as well. |
Hey @1NoOne1 I tested folder functionality as well. folder: "/vm/foo" That clone across clusters to the foo folder in the root of the datacenter. |
@dav1x I tested the folder functionality and somehow, It is not working for me. It is always deploying VMs under the root data center. I will have to look more into it. |
Am also seeing this with 2.4, but I am specifying the datastore name |
I'm seeing this as well with 2.4. In my case I'm specifying a cluster rather than hostname. it picked a completely different host in a completely different cluster to try to deploy to, hence the error. Statically assigning the hostname rather than cluster works fine. new bug in the host selection process? |
Hello dav1x; Within vCenter I can clone across clusters, but using ansible it fails. Error as below: |
@1NoOne1 This issue is waiting for your response. Please respond or the issue will be closed. |
@Akasurde This looks working now in Ansible 2.7.4. 👍 Tested the following scenarios: [the documentation needed an update]
|
Just a comment, which might be helpful. Ansible trows this sometimes but is a red herring. In my case, the issue was using the wrong datastore name for the vm disks which has nothing to do with the playbook not being able to find the template file. This should be fixed, as it lead me to a goose chase for days. Find out it was my script creating the host file not setting the datastore correctly. First, check the datastore name you are using for your vm disks. |
Closing as per #28649 (comment). Please feel free to open a new issue if problem persists. Thanks. @pgbidkar Thanks providing the information. |
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE
Running the module vmware_guest to create a VM from a template gives the following error:
"msg": "Unable to access the virtual machine configuration: Unable to access file [xio-mgmt-lun02] Test_Templatecentos7/Test_Templatecentos7.vmtx".
EXPECTED RESULTS
ACTUAL RESULTS
FAILED: Output see below (-vvvv)
The text was updated successfully, but these errors were encountered: