New Question

Revision history [back]

click to hide/show revision 1
initial version

Get username from metadata

Hello everyone, i am trying to implement cloudbase-init to my Windows vms on Proxmox. I have patched the Promox to generate data into the metadata folder where it sucessfully gets the password and the hostnam.

I am trying to push cloudbase to get the username from the metadata. I've looked into the baseopenstackservice.py to see which variable it looks for in the metadata;

def get_admin_username(self):
    return self._get_meta_data().get('meta', {}).get('admin_username')

Well my patch successfully creates the json file with admin_username variable as intended with the information i gave him throught proxmox ui.

This part of the createuser.py file seems to get the admin_username or the username from the conf file;

    def execute(self, service, shared_data):
        user_name = service.get_admin_username() or CONF.username

But cloudbase_sysprep allways use the username from the conf file and when i tried to remove it, it used the default username which is admin. Cloudbase gets the password and all the other data from the same file so it doesnt seem like a access issue and i also dont have any errors on the logs while booting. I will be releasing the patch in the proxmox forum when i finish.

Get username from metadata

Hello everyone, i am trying to implement cloudbase-init to my Windows vms on Proxmox. I have patched the Promox to generate data into the metadata folder where it sucessfully gets the password and the hostnam.

I am trying to push cloudbase to get the username from the metadata. I've looked into the baseopenstackservice.py to see which variable it looks for in the metadata;

def get_admin_username(self):
    return self._get_meta_data().get('meta', {}).get('admin_username')

Well my patch successfully creates the json file with admin_username variable as intended with the information i gave him throught proxmox ui.

This part of the createuser.py file seems to get the admin_username or the username from the conf file;

    def execute(self, service, shared_data):
        user_name = service.get_admin_username() or CONF.username

But cloudbase_sysprep allways use the username from the conf file and when i tried to remove it, it used the default username which is admin. Cloudbase gets the password and all the other data from the same file so it doesnt seem like a access issue and i also dont have any errors on the logs while booting. I will be releasing the patch in the proxmox forum when i finish.

Get Metadata doesnt override username

Hello everyone,

I've patched my proxmox to create a metadata file that can be read by cloudbase-init. It works fine for the hostname, uuid, password etc.

But cloudbase never overrides the conf username by username given by metadata.

The variable i generate is "adminusername", i've checked in the getadmin_username definition on the python modules in the cloudbase and it is the variable it looks for. (i even tried just username, it didnt work).

Cloudbase at boot always uses the conf.username and when i delete username from metadata

Hello everyone, i am trying to implement cloudbase-init to my Windows vms on Proxmox. I have patched the Promox to generate data into the metadata folder the conf file it uses default username which is Admin.

This is the part of the creatuser module where it sucessfully gets the password and the hostnam.

I am trying to push cloudbase to get the username;

usernamedef execute(self, service, shared_data):
    user_name = service.get_admin_username() or CONF.username
    shared_data[constants.SHARED_DATA_USERNAME] = user_name
 from the metadata. I've looked into the baseopenstackservice.py to see which variable it looks for in the metadata; 

the called service.getadminusername() is ;

def get_admin_username(self):
    return self._get_meta_data().get('meta', {}).get('admin_username')

Well my patch successfully creates the json file with admin_username variable as intended with the information i gave him throught proxmox ui.

This part of the createuser.py file seems to get the admin_username or the username from the conf file;

    def execute(self, service, shared_data):
        user_name = service.get_admin_username() or CONF.username

But cloudbase_sysprep allways use the username from the conf file and when i tried to remove it, it used the default username which is admin. Cloudbase gets the password and all the other data from the same file so it doesnt seem like a access issue and i also dont have any errors on the logs while booting. I will be releasing the patch in the proxmox forum when i finish.