saltstack / saltstack/salt

salt-cloud vsphere vsan virtual machine creation failure

Open
#52,802 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Salt-Cloud severity-high
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description of Issue/Question

When attempting to create a VM on vCenter 6.5 using Salt Cloud on a VSAN, the creation fails. When applying the same configuration to local ESXI storage, the VM is created.

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

centos_secure_salt:
    provider: vxrail_vcenter
    clone_from: 'template-centos7-secure-salt'
    devices:
        disk:
            Hard disk 1:
                size: 30
    cluster: '...-Virtual-SAN-Cluster-...'
    num_cpus: 2
    memory: 2GB
    network:
        Network adapter 1:
            name: es190
            switch_type: standard
            ip: ...
            gateway: ...
            subnet_mask: 255.255.0.0
            domain: ...
    domain: ...
    dns_servers: 
        - ...
        - ...
    datastore: '...-Virtual-SAN-Datastore-...'
    datacenter: '...-Datacenter'
    template: False
    power_on: False
    extra_config:
        mem.hotadd: 'yes'
    annotation: Test
    minion:
        master: saltmaster.domain.ext
    deploy: True
Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

[DEBUG   ] Closing IPCMessageClient instance
[INFO    ] Creating new_vm
[INFO    ] [ new_vm ] Waiting for create task to finish [0 s]
[ERROR   ] (vim.fault.CannotCreateFile) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   msg = 'Cannot complete file creation operation.',
   faultCause = <unset>,
   faultMessage = (vmodl.LocalizableMessage) [],
   file = '/vmfs/volumes/vsan:5292a6b5bdfbb488-d9b171feda0214ed/new_vm/new_vm-1eb02083.hlog'
}
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/utils/vmware.py", line 3153, in wait_for_task
    raise task_info.error
vim.fault.CannotCreateFile: (vim.fault.CannotCreateFile) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   msg = 'Cannot complete file creation operation.',
   faultCause = <unset>,
   faultMessage = (vmodl.LocalizableMessage) [],
   file = '/vmfs/volumes/vsan:5292a6b5bdfbb488-d9b171feda0214ed/new_vm/new_vm-1eb02083.hlog'
}
[ERROR   ] Error creating new_vm: Cannot complete file creation operation.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/cloud/clouds/vmware.py", line 2901, in create
    salt.utils.vmware.wait_for_task(task, vm_name, "create", 15, 'info')
  File "/usr/lib/python2.7/site-packages/salt/utils/vmware.py", line 3164, in wait_for_task
    raise salt.exceptions.VMwareApiError(exc.msg)
VMwareApiError: Cannot complete file creation operation.
[DEBUG   ] LazyLoaded nested.output
new_vm:
    ----------
    Error:
        Error creating new_vm: Cannot complete file creation operation.

2019-05-02T19:53:58.407Z cpu19:69226 opID=3d35b10d)osfs: OSFS_CreateFile:168: mkdir not enabled, failing mkdir request (pid: [    vsan], cid: 5292a6b5bdfbb488-d9b171feda0214ed, childName: new_vm)
Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Salt Version:
           Salt: 2019.2.0
 
Dependency Versions:
           cffi: 1.12.2
       cherrypy: unknown
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Apr  9 2019, 14:30:50)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.6.1810 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-957.5.1.el7.x86_64
         system: Linux
        version: CentOS Linux 7.6.1810 Core

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt/cloud/clouds/vmware.py around create and salt/utils/vmware.py around wait_for_task, then reproduce the supplied configuration against VSAN and local ESXi storage. Compare the task and error paths; done means the reported VSAN configuration creates the VM successfully without the CannotCreateFile failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.