Skip to content
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

salt-cloud error when underscore in minion name; vmware driver #34656

Closed
pwhack opened this issue Jul 14, 2016 · 4 comments
Closed

salt-cloud error when underscore in minion name; vmware driver #34656

pwhack opened this issue Jul 14, 2016 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior help-wanted Community help is needed to resolve this P4 Priority 4 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Milestone

Comments

@pwhack
Copy link

pwhack commented Jul 14, 2016

I'm getting a stacktrace with "invalidProperty = u'spec.identity.hostName'" when trying to deploy a VM to VMware using salt-cloud if the minion name has an underscore in the name. Using hyphens works fine. Are underscores verboten by Salt or VMware API?

-------------------------------------------------------------

[root@master salt]# salt --versions-report
Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: 0.8.6
       cherrypy: 3.2.2
       dateutil: Not Installed
          gitdb: 0.6.4
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: 0.21.0
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.7
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: 0.21.4
         Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.7.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: centos 7.2.1511 Core
        machine: x86_64
        release: 3.10.0-327.22.2.el7.x86_64
         system: Linux
        version: CentOS Linux 7.2.1511 Core

-------------------------------------------------------------

[root@master salt]# cat /etc/salt/cloud.profiles.d/dc1-vsphere.conf
minimal:
  provider: vcenter
  clonefrom: centos7-business-dev
  # Should destination VM become a template? No. (template: False)
  template: False

  datastore: DC1 Storage Cluster
  cluster: Development
  folder: Linux Development

  cpus: 1
  memory: 512
  devices:
    network:
      Network adapter 1:
         adapter_type: vmxnet3
         name: guests-dev
         switch_type: standard

  domain: dev.company.com
  dns_servers:
    - 10.15.0.10
    - 10.15.0.11

  power_on: True
  deploy: True
  private_key: /etc/salt/centos7_deploy.pem
  minion:
    master: master.company.com

-------------------------------------------------------------

[root@master salt]# cat /etc/salt/cloud.providers.d/vcenter.conf
vcenter:
  driver: vmware
  user: vsphere.local\salt_master
  password: ruhroh
  url: vcenter.company.com
  protocol: 'https'
  port: 443

-------------------------------------------------------------

[root@master salt]# salt-cloud -p minimal salt_test-1 -l debug
[DEBUG   ] Reading configuration from /etc/salt/cloud
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Including configuration from '/etc/salt/master.d/salt-api.conf'
[DEBUG   ] Reading configuration from /etc/salt/master.d/salt-api.conf
[DEBUG   ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG   ] Including configuration from '/etc/salt/cloud.providers.d/aws-us_west-2.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.providers.d/aws-us_west-2.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.providers.d/vcenter.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.providers.d/vcenter.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.providers.d/vmware.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.providers.d/vmware.conf
[DEBUG   ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/dc1-vsphere.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/dc1-vsphere.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/ec2_private.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/ec2_private.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/dc0-dev-profiles.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/dc0-dev-profiles.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/dc0-prod-profiles.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/dc0-prod-profiles.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/dc0-stage-profiles.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/dc0-stage-profiles.conf
[DEBUG   ] Including configuration from '/etc/salt/cloud.profiles.d/vmware.conf'
[DEBUG   ] Reading configuration from /etc/salt/cloud.profiles.d/vmware.conf
[DEBUG   ] Configuration file path: /etc/salt/cloud
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO    ] salt-cloud starting
[DEBUG   ] Could not LazyLoad parallels.avail_sizes
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy
[DEBUG   ] Could not LazyLoad saltify.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.avail_images
[DEBUG   ] Could not LazyLoad saltify.avail_locations
[DEBUG   ] LazyLoaded rackspace.reboot
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] LazyLoaded rackspace.list_locations
[DEBUG   ] Could not LazyLoad vmware.optimize_providers
[DEBUG   ] The 'vmware' cloud driver is unable to be optimized.
[DEBUG   ] Could not LazyLoad parallels.avail_sizes
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy
[DEBUG   ] Could not LazyLoad saltify.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.avail_images
[DEBUG   ] Could not LazyLoad saltify.avail_locations
[DEBUG   ] LazyLoaded rackspace.reboot
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] LazyLoaded rackspace.list_locations
[DEBUG   ] Could not LazyLoad parallels.avail_sizes
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy
[DEBUG   ] Could not LazyLoad saltify.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.avail_images
[DEBUG   ] Could not LazyLoad saltify.avail_locations
[DEBUG   ] LazyLoaded rackspace.reboot
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] LazyLoaded rackspace.list_locations
[DEBUG   ] Using AWS endpoint: ec2.us-west-2.amazonaws.com
[DEBUG   ] Could not LazyLoad parallels.avail_sizes
[DEBUG   ] AWS Request: https://ec2.us-west-2.amazonaws.com/?Action=DescribeInstances&Version=2014-10-01
[DEBUG   ] LazyLoaded parallels.avail_locations
[DEBUG   ] LazyLoaded proxmox.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.destroy
[DEBUG   ] Could not LazyLoad saltify.avail_sizes
[DEBUG   ] Could not LazyLoad saltify.avail_images
[DEBUG   ] Could not LazyLoad saltify.avail_locations
[DEBUG   ] LazyLoaded rackspace.reboot
[DEBUG   ] LazyLoaded openstack.list_locations
[DEBUG   ] LazyLoaded rackspace.list_locations
[WARNING ] /usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)

[WARNING ] /usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)

[DEBUG   ] AWS Response Status Code: 200
[DEBUG   ] Generating minion keys for 'salt_test-1'
[DEBUG   ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Sending event - data = {'profile': 'minimal', 'event': 'starting create', '_stamp': '2016-07-14T02:39:54.029039', 'name': 'salt_test-1', 'provider': 'vcenter:vmware'}
[WARNING ] /usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)

[DEBUG   ] Setting memory to: 512 MB
[DEBUG   ] clone_spec set to:
(vim.vm.CloneSpec) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   location = (vim.vm.RelocateSpec) {
      dynamicType = <unset>,
      dynamicProperty = (vmodl.DynamicProperty) [],
      datastore = <unset>,
      diskMoveType = <unset>,
      pool = 'vim.ResourcePool:resgroup-77',
      host = <unset>,
      disk = (vim.vm.RelocateSpec.DiskLocator) [],
      transform = <unset>,
      deviceChange = (vim.vm.device.VirtualDeviceSpec) [],
      profile = (vim.vm.ProfileSpec) []
   },
   template = false,
   config = (vim.vm.ConfigSpec) {
      dynamicType = <unset>,
      dynamicProperty = (vmodl.DynamicProperty) [],
      changeVersion = <unset>,
      name = <unset>,
      version = <unset>,
      uuid = <unset>,
      instanceUuid = <unset>,
      npivNodeWorldWideName = (long) [],
      npivPortWorldWideName = (long) [],
      npivWorldWideNameType = <unset>,
      npivDesiredNodeWwns = <unset>,
      npivDesiredPortWwns = <unset>,
      npivTemporaryDisabled = <unset>,
      npivOnNonRdmDisks = <unset>,
      npivWorldWideNameOp = <unset>,
      locationId = <unset>,
      guestId = <unset>,
      alternateGuestName = <unset>,
      annotation = <unset>,
      files = <unset>,
      tools = <unset>,
      flags = <unset>,
      consolePreferences = <unset>,
      powerOpInfo = <unset>,
      numCPUs = <unset>,
      numCoresPerSocket = <unset>,
      memoryMB = 512,
      memoryHotAddEnabled = <unset>,
      cpuHotAddEnabled = <unset>,
      cpuHotRemoveEnabled = <unset>,
      virtualICH7MPresent = <unset>,
      virtualSMCPresent = <unset>,
      deviceChange = (vim.vm.device.VirtualDeviceSpec) [
         (vim.vm.device.VirtualDeviceSpec) {
            dynamicType = <unset>,
            dynamicProperty = (vmodl.DynamicProperty) [],
            operation = 'edit',
            fileOperation = <unset>,
            device = (vim.vm.device.VirtualVmxnet3) {
               dynamicType = <unset>,
               dynamicProperty = (vmodl.DynamicProperty) [],
               key = 4000,
               deviceInfo = (vim.Description) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  label = 'Network adapter 1',
                  summary = 'guests-dev'
               },
               backing = (vim.vm.device.VirtualEthernetCard.NetworkBackingInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  deviceName = 'guests-dev',
                  useAutoDetect = <unset>,
                  network = 'vim.Network:network-49',
                  inPassthroughMode = <unset>
               },
               connectable = (vim.vm.device.VirtualDevice.ConnectInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  startConnected = true,
                  allowGuestControl = true,
                  connected = false,
                  status = 'untried'
               },
               slotInfo = (vim.vm.device.VirtualDevice.PciBusSlotInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  pciSlotNumber = 192
               },
               controllerKey = 100,
               unitNumber = 7,
               addressType = 'assigned',
               macAddress = '00:50:56:90:93:64',
               wakeOnLanEnabled = false
            },
            profile = (vim.vm.ProfileSpec) []
         }
      ],
      cpuAllocation = <unset>,
      memoryAllocation = <unset>,
      latencySensitivity = <unset>,
      cpuAffinity = <unset>,
      memoryAffinity = <unset>,
      networkShaper = <unset>,
      cpuFeatureMask = (vim.vm.ConfigSpec.CpuIdInfoSpec) [],
      extraConfig = (vim.option.OptionValue) [],
      swapPlacement = <unset>,
      bootOptions = <unset>,
      vAppConfig = <unset>,
      ftInfo = <unset>,
      vAppConfigRemoved = <unset>,
      vAssertsEnabled = <unset>,
      changeTrackingEnabled = <unset>,
      firmware = <unset>,
      maxMksConnections = <unset>,
      guestAutoLockEnabled = <unset>,
      managedBy = <unset>,
      memoryReservationLockedToMax = <unset>,
      nestedHVEnabled = <unset>,
      vPMCEnabled = <unset>,
      scheduledHardwareUpgradeInfo = <unset>,
      vmProfile = (vim.vm.ProfileSpec) []
   },
   customization = (vim.vm.customization.Specification) {
      dynamicType = <unset>,
      dynamicProperty = (vmodl.DynamicProperty) [],
      options = <unset>,
      identity = (vim.vm.customization.LinuxPrep) {
         dynamicType = <unset>,
         dynamicProperty = (vmodl.DynamicProperty) [],
         hostName = (vim.vm.customization.FixedName) {
            dynamicType = <unset>,
            dynamicProperty = (vmodl.DynamicProperty) [],
            name = 'salt_test-1'
         },
         domain = 'dev.company.com',
         timeZone = <unset>,
         hwClockUTC = <unset>
      },
      globalIPSettings = (vim.vm.customization.GlobalIPSettings) {
         dynamicType = <unset>,
         dynamicProperty = (vmodl.DynamicProperty) [],
         dnsSuffixList = (str) [],
         dnsServerList = (str) [
            '10.15.0.10',
            '10.15.0.11'
         ]
      },
      nicSettingMap = (vim.vm.customization.AdapterMapping) [
         (vim.vm.customization.AdapterMapping) {
            dynamicType = <unset>,
            dynamicProperty = (vmodl.DynamicProperty) [],
            macAddress = <unset>,
            adapter = (vim.vm.customization.IPSettings) {
               dynamicType = <unset>,
               dynamicProperty = (vmodl.DynamicProperty) [],
               ip = (vim.vm.customization.DhcpIpGenerator) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) []
               },
               subnetMask = <unset>,
               gateway = (str) [],
               ipV6Spec = <unset>,
               dnsServerList = (str) [],
               dnsDomain = <unset>,
               primaryWINS = <unset>,
               secondaryWINS = <unset>,
               netBIOS = <unset>
            }
         }
      ],
      encryptionKey = (byte) []
   },
   powerOn = true,
   snapshot = <unset>,
   memory = <unset>
}
[DEBUG   ] MasterEvent PUB socket URI: /var/run/salt/master/master_event_pub.ipc
[DEBUG   ] MasterEvent PULL socket URI: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/master/master_event_pull.ipc
[DEBUG   ] Sending event - data = {'_stamp': '2016-07-14T02:39:56.661935', 'event': 'requesting instance', 'kwargs': {'profile': 'minimal', 'private_key': '/etc/salt/centos7_deploy.pem', 'dns_servers': ['10.15.0.10', '10.15.0.11'], 'protocol': 'https', 'deploy': True, 'minion': {'master': 'master.company.com'}, 'memory': 512, 'driver': 'vcenter:vmware', 'domain': 'dev.company.com', 'cpus': 1, 'cluster': 'Development', 'priv_key': '-----BEGIN RSA PRIVATE KEY-----\n\n-----END PUBLIC KEY-----', 'devices': {'network': {'Network adapter 1': {'switch_type': 'standard', 'adapter_type': 'vmxnet3', 'name': 'guests-dev'}}}, 'folder': 'Linux Development', 'template': False, 'update_cachedir': True, 'os': 'bootstrap-salt', 'inline_script': None}}
[INFO    ] Creating salt_test-1 from vm(centos7-business-dev)
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [0 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [5 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [10 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [15 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [20 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [25 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [30 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [35 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [40 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [45 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [50 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [55 s]
[INFO    ] [ salt_test-1 ] Waiting for apply storage DRS recommendations task to finish [60 s]
[ERROR   ] Error creating salt_test-1: (vmodl.fault.InvalidArgument) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   msg = 'A specified parameter was not correct: spec.identity.hostName',
   faultCause = <unset>,
   faultMessage = (vmodl.LocalizableMessage) [],
   invalidProperty = u'spec.identity.hostName'
}
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/cloud/clouds/vmware.py", line 2404, in create
    salt.utils.vmware.wait_for_task(task, vm_name, 'apply storage DRS recommendations', 5, 'info')
  File "/usr/lib/python2.7/site-packages/salt/utils/vmware.py", line 648, in wait_for_task
    raise Exception(task.info.error)
Exception: (vmodl.fault.InvalidArgument) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   msg = 'A specified parameter was not correct: spec.identity.hostName',
   faultCause = <unset>,
   faultMessage = (vmodl.LocalizableMessage) [],
   invalidProperty = u'spec.identity.hostName'
}
[DEBUG   ] LazyLoaded nested.output
salt_test-1:
    ----------
    Error:
        Error creating salt_test-1: (vmodl.fault.InvalidArgument) {
           dynamicType = <unset>,
           dynamicProperty = (vmodl.DynamicProperty) [],
           msg = 'A specified parameter was not correct: spec.identity.hostName',
           faultCause = <unset>,
           faultMessage = (vmodl.LocalizableMessage) [],
           invalidProperty = u'spec.identity.hostName'
        }

@techhat
Copy link
Contributor

techhat commented Jul 14, 2016

@techhat techhat closed this as completed Jul 14, 2016
@techhat techhat reopened this Jul 14, 2016
@rallytime
Copy link
Contributor

rallytime commented Jul 15, 2016

We should catch that error up further in the create function (warn and exit) if a VM name contains an underscore (we do a similar check in the Linode driver), as well as document this in the VMWare driver documentation.

@rallytime rallytime added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around help-wanted Community help is needed to resolve this Salt-Cloud P4 Priority 4 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. labels Jul 15, 2016
@rallytime rallytime added this to the Approved milestone Jul 15, 2016
@borisovano
Copy link

@techhat IMHO the article above is about 'vCenter Server with host name containing an underscore' while the bug is opened on VM

From my experience with other tools, underscores in VM name are fully supported, hence @rallytime I don't understand why the suggested way of dealing with this is to catch rather than allow.

@stale
Copy link

stale bot commented Mar 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Mar 2, 2019
@stale stale bot closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior help-wanted Community help is needed to resolve this P4 Priority 4 RIoT Relates to integration with cloud providers, hypervisors, API-based services, etc. Salt-Cloud severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Projects
None yet
Development

No branches or pull requests

4 participants