Error while upgrading SQL server 2012 to SQL 2017 : Failed to create a new folder 'X:\\xxxx'. The specified path is invalid
At the first sign of trouble during an in-place upgrade, fallback to a side-by-side upgrade.  Install a new instance of SQL 2017, preferably on a new VM, and migrate the databases, logins, jobs and settings from your old instance.