Identify host of lxc containers when connecting via sshDummy interface in an LXC guestAccess lxc container...

What defenses are there against being summoned by the Gate spell?

"You are your self first supporter", a more proper way to say it

How can I make my BBEG immortal short of making them a Lich or Vampire?

What would happen to a modern skyscraper if it rains micro blackholes?

Why, historically, did Gödel think CH was false?

Prove that NP is closed under karp reduction?

How is it possible to have an ability score that is less than 3?

LaTeX closing $ signs makes cursor jump

Test whether all array elements are factors of a number

Email Account under attack (really) - anything I can do?

Why doesn't H₄O²⁺ exist?

strToHex ( string to it's hex representation as string)

Can I ask the recruiters in my resume to put the reason why I am rejected?

What does "Puller Prush Person" mean?

Python: next in for loop

Why was the small council so happy for Tyrion to become the Master of Coin?

An academic/student plagiarism

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

Why did Neo believe he could trust the machine when he asked for peace?

Minkowski space

Problem of parity - Can we draw a closed path made up of 20 line segments...

Test if tikzmark exists on same page

What is the offset in a seaplane's hull?

How old can references or sources in a thesis be?



Identify host of lxc containers when connecting via ssh


Dummy interface in an LXC guestAccess lxc container services from other lxc containers via hostConfiguring LXC containers to use a host bridge under CentOS 7LXD containers and networking with static IPlxd-type container static IP in profileOrchestration of lxc/ldxd containersEnabling cross-host container communication under a VMware ESXi environmentBridge needs IP on host when bridging lxc containers?Group containers in LXCCommunitaction between lxc contaners running on separate virtualboxes(vagrant)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have plenty of servers (>100), mostly centos, ubuntu and some windows servers, monitored with Zabbix. Many of those servers are virtualized with vanilla LXC version 2 or version 3 (no libvirt, no LXD, no proxmox or similar). I am new to this environment and it's difficult for me to understand which machine is virtualized and where it is hosted.



So, I need a way to identify the LXC host when connecting with ssh to any of those servers.



To identify if I am actually within a LXC container, I can use



systemd-detect-virt


on systems with systemd. The output is telling me if I am within a container or not.



But I need more. I need to have a way to identify on which host that LXC container is hosted. I know that LXC containers are supposed to be as close as possible to a physical machine and that it might be unnecessary to know about the host system. But I need to maintain this environment. In addition, other system admins are adding, moving (many of the hosts are clustered), deleting LXC containers.



Is there a way which allows me to find the actual host where an LXC container is running on, without having to move over to virtualization platforms like proxmox and the lot?



I am willing and able to edit LXC container's config files. Perhaps there is something like a tag that is later on visible within the LXC container itself?



Thanks for your help.



Dan










share|improve this question







New contributor




I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    I have plenty of servers (>100), mostly centos, ubuntu and some windows servers, monitored with Zabbix. Many of those servers are virtualized with vanilla LXC version 2 or version 3 (no libvirt, no LXD, no proxmox or similar). I am new to this environment and it's difficult for me to understand which machine is virtualized and where it is hosted.



    So, I need a way to identify the LXC host when connecting with ssh to any of those servers.



    To identify if I am actually within a LXC container, I can use



    systemd-detect-virt


    on systems with systemd. The output is telling me if I am within a container or not.



    But I need more. I need to have a way to identify on which host that LXC container is hosted. I know that LXC containers are supposed to be as close as possible to a physical machine and that it might be unnecessary to know about the host system. But I need to maintain this environment. In addition, other system admins are adding, moving (many of the hosts are clustered), deleting LXC containers.



    Is there a way which allows me to find the actual host where an LXC container is running on, without having to move over to virtualization platforms like proxmox and the lot?



    I am willing and able to edit LXC container's config files. Perhaps there is something like a tag that is later on visible within the LXC container itself?



    Thanks for your help.



    Dan










    share|improve this question







    New contributor




    I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have plenty of servers (>100), mostly centos, ubuntu and some windows servers, monitored with Zabbix. Many of those servers are virtualized with vanilla LXC version 2 or version 3 (no libvirt, no LXD, no proxmox or similar). I am new to this environment and it's difficult for me to understand which machine is virtualized and where it is hosted.



      So, I need a way to identify the LXC host when connecting with ssh to any of those servers.



      To identify if I am actually within a LXC container, I can use



      systemd-detect-virt


      on systems with systemd. The output is telling me if I am within a container or not.



      But I need more. I need to have a way to identify on which host that LXC container is hosted. I know that LXC containers are supposed to be as close as possible to a physical machine and that it might be unnecessary to know about the host system. But I need to maintain this environment. In addition, other system admins are adding, moving (many of the hosts are clustered), deleting LXC containers.



      Is there a way which allows me to find the actual host where an LXC container is running on, without having to move over to virtualization platforms like proxmox and the lot?



      I am willing and able to edit LXC container's config files. Perhaps there is something like a tag that is later on visible within the LXC container itself?



      Thanks for your help.



      Dan










      share|improve this question







      New contributor




      I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have plenty of servers (>100), mostly centos, ubuntu and some windows servers, monitored with Zabbix. Many of those servers are virtualized with vanilla LXC version 2 or version 3 (no libvirt, no LXD, no proxmox or similar). I am new to this environment and it's difficult for me to understand which machine is virtualized and where it is hosted.



      So, I need a way to identify the LXC host when connecting with ssh to any of those servers.



      To identify if I am actually within a LXC container, I can use



      systemd-detect-virt


      on systems with systemd. The output is telling me if I am within a container or not.



      But I need more. I need to have a way to identify on which host that LXC container is hosted. I know that LXC containers are supposed to be as close as possible to a physical machine and that it might be unnecessary to know about the host system. But I need to maintain this environment. In addition, other system admins are adding, moving (many of the hosts are clustered), deleting LXC containers.



      Is there a way which allows me to find the actual host where an LXC container is running on, without having to move over to virtualization platforms like proxmox and the lot?



      I am willing and able to edit LXC container's config files. Perhaps there is something like a tag that is later on visible within the LXC container itself?



      Thanks for your help.



      Dan







      linux ssh lxc zabbix






      share|improve this question







      New contributor




      I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      I grok itI grok it

      1




      1




      New contributor




      I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      I grok it is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          I grok it is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1421868%2fidentify-host-of-lxc-containers-when-connecting-via-ssh%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          I grok it is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          I grok it is a new contributor. Be nice, and check out our Code of Conduct.













          I grok it is a new contributor. Be nice, and check out our Code of Conduct.












          I grok it is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1421868%2fidentify-host-of-lxc-containers-when-connecting-via-ssh%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...