GitHub user Ye-Min-Tun added a comment to the discussion: UserData for Windows VMs?
@weizhouapache I set the `metadata_services`, but still didn't work. What did I miss to configure? Here's the `cloudbase-init-unattend.conf ` ``` [DEFAULT] username=Admin groups=Administrators inject_user_password=true config_drive_raw_hhd=true config_drive_cdrom=true config_drive_vfat=true bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\ verbose=true debug=true log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\ log_file=cloudbase-init-unattend.log default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN logging_serial_port_settings=COM1,115200,N,8 mtu_use_dhcp_config=true ntp_use_dhcp_config=true local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\ check_latest_version=false metadata_services=cloudbaseinit.metadata.services.cloudstack.CloudStack plugins = cloudbaseinit.plugins.common.mtu.MTUPlugin, cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin, cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin, cloudbaseinit.plugins.windows.createuser.CreateUserPlugin, cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin, cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin, cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin, cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin, cloudbaseinit.plugins.common.userdata.UserDataPlugin, cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin, cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin, cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin, cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin allow_reboot=false stop_service_on_exit=false ``` And I tried this two userdata in Cloudstack. ``` #cloud-config runcmd: - 'powershell.exe -Command "New-Item -Path C:\TestDir -ItemType Directory"' - 'powershell.exe -Command "New-Item -Path C:\TestDir\testfile.txt -ItemType File"' - 'powershell.exe -Command "Add-Content -Path C:\TestDir\testfile.txt -Value ''Hello, CloudStack!''"' ``` ``` #ps1_sysnative Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force $logPath = "C:\Users\Public\userdata.log" "Script executed" | Out-File $logPath ``` Or is there anything wrong with my userdata script? GitHub link: https://github.com/apache/cloudstack/discussions/9584#discussioncomment-10528880 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected]
