XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Simulating network cable disconnect

    Scheduled Pinned Locked Moved Xen Orchestra
    11 Posts 5 Posters 1.3k Views 5 Watching
    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.
    • splastunovS Offline
      splastunov
      last edited by

      xe vif-unplug uuid=[vif_uuid]
      

      or use XenCenter and on Network tab press button Deactivate

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by olivierlambert

        IIRC, vif-unplug is exactly the same as "Disconnect" in XO. You might be better to use ovs commands to stop traffic without the guest knowing.

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          ashinobi @olivierlambert
          last edited by

          @olivierlambert

          thanks for the reply, I am trying to check the ovs command and what would be the best parameter to use to simulate this.

          Also if possible maybe this can be added as feature request in future release for XO. This will help when trying to do some test on certain application and also for studies (like in my case trying to learn wireshark). This is a great to have feature.

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            OVS API isn't exposed in XAPI, so the answer is no. You can have however use the SDN features of XO or use allowed IP to artificially block it.

            A 1 Reply Last reply Reply Quote 0
            • A Offline
              ashinobi @olivierlambert
              last edited by

              @olivierlambert

              Thanks for sharing that information.

              K 1 Reply Last reply Reply Quote 0
              • K Offline
                KPS Top contributor @ashinobi
                last edited by

                This is an old thread, but to keep it in one place: is there any option to start a VM with disconnected vif?

                splastunovS 1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  I think the VIF is connected automatically on boot. The best approach is to remove the VIF and create it anytime later when you need it.

                  1 Reply Last reply Reply Quote 0
                  • splastunovS Offline
                    splastunov @KPS
                    last edited by

                    @KPS said in Simulating network cable disconnect:

                    This is an old thread, but to keep it in one place: is there any option to start a VM with disconnected vif?

                    as workaround/trick you can use locking mode.
                    Set it to "locked" and do not allow any IP, so all traffic will be dropped on this VIF. It will be like "disabled". After that you can set locking mode to "unlocked" to allow any traffic.

                    K O 2 Replies Last reply Reply Quote 0
                    • K Offline
                      KPS Top contributor @splastunov
                      last edited by

                      @splastunov
                      Great idea! Thank you!

                      1 Reply Last reply Reply Quote 0
                      • O Offline
                        olympicgreg @splastunov
                        last edited by olympicgreg

                        @splastunov I realize this thread is old, but I think there is important info to keep connected to this thread for future readers.

                        The IP locking trick doesn't seem to prevent all traffic -- it only prevents traffic that has an IP that isn't 255.255.255.255 (and possibly others as well). That is, I can still successfully acquire a DHCP IP even when the IP locking mechanism is engaged. I think this is important for others to know since it doesn't fully isolate VMs like the OP wanted.

                        UPDATE: Setting the locking mode to "disabled" is what you want -- not "locked". Disabled will drop all traffic; locked simply checks if the set of IPs in the VM is permitted. Source: https://docs.xenserver.com/en-us/citrix-hypervisor/networking/manage.html#vif-locking-mode-states

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