ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    XenServer - Rename guest within guest?

    IT Discussion
    3
    6
    649
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • anthonyhA
      anthonyh
      last edited by

      I built a script that I use with my Linux (CentOS) template that eases standing up Linux VMs (very handy). It walks me through IPing the host, setting the hostname, joining it to AD, and making sure it's up to date.

      Something I just thought of and am wondering if it's possible is re-naming the VM from within the VM.

      In my environment, the guest name as displayed in XenCenter is equal to the guest's real hostname. What I'd like to do is have my script then "apply" this name to the guest. And, even a step forward, also re-name the virtual disk too.

      Is this possible?

      black3dynamiteB 1 Reply Last reply Reply Quote 1
      • momurdaM
        momurda
        last edited by

        I have wondered about this same as you.
        Your current script, is it in ~ of the template user? It runs within the vms you make?

        I don't think XS can do anything with the vms it hosts other than turn on/off, migrate, suspend, delete, expand, other things like that.
        If you look at xe vm-??? command list you will see all the things you can do only involve vm operation or virtual hardware actions.

        anthonyhA 1 Reply Last reply Reply Quote 0
        • black3dynamiteB
          black3dynamite @anthonyh
          last edited by

          @anthonyh said in XenServer - Rename guest within guest?:

          I built a script that I use with my Linux (CentOS) template that eases standing up Linux VMs (very handy). It walks me through IPing the host, setting the hostname, joining it to AD, and making sure it's up to date.

          Something I just thought of and am wondering if it's possible is re-naming the VM from within the VM.

          In my environment, the guest name as displayed in XenCenter is equal to the guest's real hostname. What I'd like to do is have my script then "apply" this name to the guest. And, even a step forward, also re-name the virtual disk too.

          Is this possible?

          Maybe you can ssh using key file to XenServer and then use your xapi commands to capture the VM name so you can rename your guest VM. You can probably to do the same with renaming virtual disk too.

          anthonyhA 1 Reply Last reply Reply Quote 0
          • anthonyhA
            anthonyh @momurda
            last edited by

            @momurda said in XenServer - Rename guest within guest?:

            I have wondered about this same as you.
            Your current script, is it in ~ of the template user? It runs within the vms you make?

            I don't think XS can do anything with the vms it hosts other than turn on/off, migrate, suspend, delete, expand, other things like that.
            If you look at xe vm-??? command list you will see all the things you can do only involve vm operation or virtual hardware actions.

            The script resides within the template and I manually run it when I create VMs based off the template.

            1 Reply Last reply Reply Quote 0
            • anthonyhA
              anthonyh @black3dynamite
              last edited by

              @black3dynamite said in XenServer - Rename guest within guest?:

              @anthonyh said in XenServer - Rename guest within guest?:

              I built a script that I use with my Linux (CentOS) template that eases standing up Linux VMs (very handy). It walks me through IPing the host, setting the hostname, joining it to AD, and making sure it's up to date.

              Something I just thought of and am wondering if it's possible is re-naming the VM from within the VM.

              In my environment, the guest name as displayed in XenCenter is equal to the guest's real hostname. What I'd like to do is have my script then "apply" this name to the guest. And, even a step forward, also re-name the virtual disk too.

              Is this possible?

              Maybe you can ssh using key file to XenServer and then use your xapi commands to capture the VM name so you can rename your guest VM. You can probably to do the same with renaming virtual disk too.

              That's not a bad idea! I may look into this.

              1 Reply Last reply Reply Quote 1
              • momurdaM
                momurda
                last edited by momurda

                I was thinking ssh too.
                You would need to run ssh into your vm from xs#
                then run your template script, but save the machine name info as a variable that xs can use locally
                Then run xe vm-param-set uuid=uuidofvm name-label=$variable
                Then run xe vdi-param-set uuid=uuidofvm name-label=$variable.disk0
                Or something like that. Youll probably have to mess with single and double quotes somewhere

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post