cisconutanix

Issue with FTD Provisioning on Nutanix V2 API - Password Not Working


I'm running into an issue while provisioning Cisco FTD on Nutanix using the V2 API. When I deploy the VM without a Day 0 configuration file, the default password works fine. However, when I attempt to set a custom password using vm_customization_config, neither the default nor the configured password works.

🔹 Setup Details:

🔹 Day 0 Configuration JSON Used:

{
    "EULA": "accept",
    "Hostname": "ftdv-test2",
    "AdminPassword": "xxxxxxxxxx",
    "FirewallMode": "routed",
    "DNS1": "8.8.8.8",
    "DNS2": "",
    "DNS3": "",
    "IPv4Mode": "manual",
    "IPv4Addr": "XXX.XXX.XXX.XXX",
    "IPv4Mask": "255.255.254.0",
    "IPv4Gw": "XXX.XXX.XXX.XXX",
    "IPv6Mode": "disabled",
    "FmcIp": "XXX.XXX.XXX.XXX",
    "FmcRegKey": "Cisco123",
    "FmcNatId": "",
    "ManageLocally": "No"
}

🔹 Configuration Applied During VM Creation

# Convert JSON to Base64
day0_config_content = json.dumps(ftd_config, indent=4)
encoded_userdata = base64.b64encode(day0_config_content.encode()).decode()

# Add `vm_customization_config`
ftd_vm_create["vm_customization_config"] = {
    "datasource_type": "CONFIG_DRIVE_V2",
    "files_to_inject_list": [],
    "fresh_install": True,
    "userdata": encoded_userdata,
    # "userdata_path": "/cisco/ftd/day0-config.txt"
}

🔹 What I Tried:

Tried logging in with admin / Admin123 and admin / xxxxxxxx — Both failed.

Is anyone else faced this issue?

passowrd error


Solution

  • I was able to resolve this issue.

    The problem was with the encoded_userdata. I initially had the following line in my code:

    encoded_userdata = base64.b64encode(day0_config_content.encode()).decode()
    

    Removing that line entirely and just passing the raw JSON string directly worked:

    day0_config_content = json.dumps(ftd_config, indent=4)
    
    ftd_vm_create["vm_customization_config"] = {
        "datasource_type": "CONFIG_DRIVE_V2",
        "files_to_inject_list": [],
        "fresh_install": True,
        "userdata": day0_config_content,
    }
    

    After removing the Base64 encoding, the password started working correctly, and I was able to log in with the AdminPassword provided in the Day 0 config.

    Hope this helps someone else facing the same issue.