Skip to content

Migration fails when VM name contains special characters (dots, accents, ñ, etc.) #213

@gpereirm

Description

@gpereirm

Problem

Migration fails with error "Failed create instance" when VMware VM names contain special characters.

Examples that fail:

  • XDA_SA_Random_S.A.U._5283742 (dots)
  • España_VM (ñ character)
  • Test.VM.Name (dots)

Error:

TASK [os_migrate.vmware_migration_kit.import_workloads : Create instance]
fatal: [conversion_host]: FAILED! => {"msg": "Failed create instance: ..."}

Attached is a screenshot of the error and the AWX log.

Image [job_40193.txt](https://github.com/user-attachments/files/25212453/job_40193.txt)

Expected Behavior

Migration should handle any valid VMware VM name, regardless of special characters.

Actual Behavior

OpenStack Nova rejects the instance creation because the VM name contains invalid characters.

Notes

Your collection already has SafeVmName() function in plugins/module_utils/utils.go:74 that sanitizes names, but it's only used for log files, not for OpenStack resource creation.

The unsanitized VM name is passed directly to:

  • plugins/modules/src/migrate/migrate.go:226 (volume creation)
  • plugins/modules/src/create_server/create_server.go:156 (instance creation)
  • plugins/module_utils/openstack/openstack.go:491 (Nova API)

Reproduction

  1. Create VM in VMware with dots or accents in the name
  2. Run migration playbook
  3. Fails at instance creation step

Current Workaround

Manually rename VMs in VMware to use only [a-zA-Z0-9_] before migration. Not a option for us.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions