virtual
25 TopicsShrink/Compact BIGIP VE Virtual Disk
After running for a while, BIG-IP VE virtual disk size might grow much beyond the actual size of the contained files. For lab environment VE 16.1, I see the used space for is 6.4 GB. If the virtual disk size is more than 7.5 GB, that usually means there is physical space that can be saved. Before running shrink command, the unused space of the virtual disk needs to be zeroed. Best way of zeroing is mounting the partitions or logical volumes then run fstrim. It finishes instantly and doesn't need to actually writes zero to the unused space. It is better than "cat /dev/zero ..." or zerofill which actually needs to write zero and takes lots of time for large size. Zeroing steps: BIG-IP VE uses old Linux distro release that doesn't have builtin fstrim. Hence we need to attach the virtual disk to other Linux system that as fstrim. Shutdown VW virtual machine, then attach the virtual disk file to other Linux machine. If you don't have a Linux VM, you can create empty Linux VM and boot it using Linux iso. I usually use system rescue iso from https://www.system-rescue.org/Download/. BIG-IP VE use LVM volumes as seen in below fdisk output. The /, /var & etc. are stored in LVM volumes. vgscan command will automatically scan LVM volumes and create /dev/dm-*. Device Boot Start End Sectors Size Id Type /dev/sdb1 * 1 409599 409599 200M b W95 FAT32 /dev/sdb2 409600 442367 32768 16M 82 Linux swap / Solaris /dev/sdb3 442368 171965455 171523088 81.8G 8e Linux LVM Run the following commands to do mounting and fstrim on VE virtual disk partitions and LVM volumes. For subsequent usages, store it as file in the Linux VM, e.g. as /var/tmp/trimf5.sh vgscan ###fstrim can't trim swap partition, so need to reformat swap volume as ext4. swapuuid=`blkid /dev/vg-db-vda/dat.swapvol | awk -F "\"" '{print $2}'` mkfs.ext4 -F /dev/vg-db-vda/dat.swapvol for i in `ls -1 /dev/dm-*` do mkdir -p "/tempdir"$i mount $i "/tempdir"$i done fstrim -avvv sleep 2 ###Second fstrim to confirm results of first fstrim. fstrim -avvv for i in `ls -1 /dev/dm-*` do umount $i done mkswap -U $swapuuid /dev/vg-db-vda/dat.swapvol Zeroing result: [root@localhost tmp]# sh trimf5.sh Found volume group "vg-db-vda" using metadata type lvm2 mke2fs 1.46.5 (30-Dec-2021) /dev/vg-db-vda/dat.swapvol contains a swap file system Discarding device blocks: done Creating filesystem with 256000 4k blocks and 64000 inodes Filesystem UUID: 5ae4f6eb-b9ea-41d4-b710-b582eb4a5fa6 Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Allocating group tables: done Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done /tempdir/dev/dm-8: 3.9 GiB (4180942848 bytes) trimmed on /dev/mapper/vg--db--vda-set.1._var /tempdir/dev/dm-7: 2 GiB (2195013632 bytes) trimmed on /dev/mapper/vg--db--vda-set.1._config /tempdir/dev/dm-6: 840.6 MiB (881397760 bytes) trimmed on /dev/mapper/vg--db--vda-set.1._usr /tempdir/dev/dm-5: 323.9 MiB (339643392 bytes) trimmed on /dev/mapper/vg--db--vda-set.1.root /tempdir/dev/dm-4: 965.8 MiB (1012744192 bytes) trimmed on /dev/mapper/vg--db--vda-dat.swapvol /tempdir/dev/dm-3: 2.8 GiB (2958065664 bytes) trimmed on /dev/mapper/vg--db--vda-dat.log /tempdir/dev/dm-2: 23.7 GiB (25492357120 bytes) trimmed on /dev/mapper/vg--db--vda-dat.appdata /tempdir/dev/dm-1: 14.5 GiB (15615614976 bytes) trimmed on /dev/mapper/vg--db--vda-dat.share /tempdir/dev/dm-0: 280.5 MiB (294090752 bytes) trimmed on /dev/mapper/vg--db--vda-dat.maint.1 /boot/efi: 493.4 MiB (517373952 bytes) trimmed on /dev/sda1 /: 31.8 GiB (34121232384 bytes) trimmed on /dev/sda2 /tempdir/dev/dm-8: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-set.1._var /tempdir/dev/dm-7: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-set.1._config /tempdir/dev/dm-6: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-set.1._usr /tempdir/dev/dm-5: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-set.1.root /tempdir/dev/dm-4: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-dat.swapvol /tempdir/dev/dm-3: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-dat.log /tempdir/dev/dm-2: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-dat.appdata /tempdir/dev/dm-1: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-dat.share /tempdir/dev/dm-0: 0 B (0 bytes) trimmed on /dev/mapper/vg--db--vda-dat.maint.1 /boot/efi: 493.4 MiB (517373952 bytes) trimmed on /dev/sda1 /: 0 B (0 bytes) trimmed on /dev/sda2 mkswap: /dev/vg-db-vda/dat.swapvol: warning: wiping old ext4 signature. Setting up swapspace version 1, size = 1000 MiB (1048571904 bytes) no label, UUID=6be1839d-eb37-4710-9687-833dd206b6f2 [root@localhost tmp]# Compacting steps: Poweroff the Linux VM, then run VM host's shrink/compact procedure. For Hyper-V, execute powershell command: Optimize-VHD -Path bigip161.vhdx -Mode Full. Change the file name according to your virtual disk file name. https://learn.microsoft.com/en-us/powershell/module/hyper-v/optimize-vhd In my lab environment, compacting reduce the physical virtual disk to around 6.8 GB. Hyper-V also provide GUI menu for compacting but doesn't show the used Mode. VMware and KVM also provides GUI menu and command line for compacting virtual disk. Finally, reboot to run regular VE again.62Views1like0Commentsget virtual list based on vip/destination filter [request params]?
Hi folks and python developers, I am looking for a solution to a question. Currently I am using python sdk to get the list of the virtuals with filter option as partition and destination/vip? I have tried following things and unable to achieve that: virtuals = mgmt.tm.ltm.virtuals.get_collection(requests_params={ 'params': 'expandSubcollections=true&$filter=partition+eq+partition&$destination+eq+vip')} What I am trying to do is for a given device , partition, vip I want to get the list of the virtuals. s there a way to wild card for destination? articles i referred are: 1) https://devcentral.f5.com/s/articles/getting-started-with-the-python-sdk-part-4-working-with-request-parameters-31420 2) https://devcentral.f5.com/s/articles/demystifying-icontrol-rest-part-3-how-to-pass-query-parameters-and-tmsh-options 3)538Views0likes1Commenttmsh script to change a profile in all virtual servers in all partitions
Inspired by some articles on devcentral ( in special Stop Using the Base TCP Profile! and Rapid iRule Removal via Tmsh Script ), I decided to write a tmsh script to replace a profile for all virtual servers in all partitions. Maybe someone can use it or has any hints for optimization. Example: root@(lab1)(cfg-sync Standalone)(Active)(/Common)(tmos) create cli alias shared changeprofile command "run cli script changeProfile.tcl" root@(lab1)(cfg-sync Standalone)(Active)(/Common)(tmos) changeprofile /Common/tcp /Common/tcp-lan-optimized The /Common/tcp profile was replaced with the /Common/tcp-lan-optimized profile for the following virtuals in partition /Common : The /Common/tcp profile was replaced with the /Common/tcp-lan-optimized profile for the following virtuals in partition /LAB1 : testvip1-http testvip1-https testvip2-https tmsh script: cli script changeProfile.tcl { proc script::init {} { set ::info "Usage: changeprofile IMPORTANT: ALL virtual servers in ALL partitions!" } proc script::run {} { if { $tmsh::argc != 3 } { puts $::info exit 0 } set old_profile [lindex $tmsh::argv 1] set new_profile [lindex $tmsh::argv 2] set all_partitions [tmsh::get_config auth partition] foreach partition $all_partitions { set current_partition "/[lindex [split $partition " "] 2]" tmsh::cd $current_partition set profiles "" set vips [tmsh::get_config /ltm virtual] puts "The $old_profile profile was replaced with the $new_profile profile for the following virtuals in partition $current_partition : " tmsh::begin_transaction foreach vip $vips { set profiles [tmsh::get_field_value $vip "profiles"] if { $profiles contains $old_profile } { tmsh::modify /ltm virtual [tmsh::get_name $vip] profiles delete "{" $old_profile "}" profiles add "{" $new_profile "}" puts "\t[tmsh::get_name $vip]" } } tmsh::commit_transaction } } proc script::help {} { if { $tmsh::argc != 3 } { tmsh::add_help $::info } } proc script::tabc {} { if { $tmsh::argc != 3 } { tmsh::add_tabc $::info } } }414Views0likes0CommentsiRule to Redirect to Another VS on the same LTM
Hi guys - I'm trying to get the following scenario working: My domain "; maps to a public IP "1.1.1.1" and I have a virtual server configured on my F5 with "1.1.1.1:443" I have two unrelated applications with competing requirements running on different URIs on the same domain , one is a HR application (/abc) and the other is a inventory application (/def) I need to create a design which accomodates both applications with a single domain name, and find a way to accomodate both their conflicting requirements under the same domain name To solve this problem, I thought that I should do something like this, on the main virtual server 1.1.1.1:443, I put in an iRule with the following code: when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/abc" } { virtual VS2 } else if { [string tolower [HTTP::uri]] starts_with "/def" } { virtual VS3 } else { HTTP::respond 200 content "Unrecognised URI, please recheck your address" } } This would redirect incoming requests with "/abc" in the URI string to VS2 and incoming requests with "/def" in the URI string to VS3. Then I could create customised solutions for both applications in their respective virtual servers. So drawing this flow out, I think this is how it would look: But what I don't understand is how the Return Traffic and the Persistence Profiles work in this scenario. How do I make sure that the traffic flows this way: User to Server: User > VS1 > VS2 > Pool 2 (Server) Server to User: Pool 2 (Server) > VS2 > VS1 > User Do I do SNAT Auto Map on both VS1 and VS2 or do I just do SNAT Auto Map on VS2 with Auto Last Hop enabled? And on the question of persistence, if I intend to use source_addr persistence - I would definitely not be able to do a SNAT Auto Map on VS1, how do I then ensure that when the server responds, VS2 sends the traffic back to the user via VS1?4.1KViews0likes3CommentsRemoving the 'reject' keyword from a virtual, using TMSH / iApp
I have an iApp which creates a virtual server. Depending on one of my iApp choices, this is either configured as a normal load-balancing virtual server (displayed as "Standard" in the web GUI), or to reject all traffic (displayed as "Reject" in the web GUI) However, I cannot seem to find a way to toggle the 'reject' value and turn it back into a normal virtual server. For example, the current iApp template code contains: set cmd "ltm virtual ${vname} destination ${ip}:${port}" if {[iapp::is ::net__reject "yes"]} { append cmd " reject" } iapp::conf create $cmd If I create a new application based on this template and set the net.reject choice to no, it creates the virtual server without the reject keyword; if I then reconfigure and set the net.reject choice to yes it modifies the virtual server and adds the reject keyword; but if I reconfigure again and set the net.reject choice back to no it does not remove the reject keyword. So how does one remove the reject keyword in my iApp (or in tmsh, for that matter)?493Views0likes14CommentsIs there Limitation of irule "virtual".. can we do it like this?
Hi We have BIG-IQ and BIG-IP AWAF. I see that BIG-IQ application dashboard is show only 1 application per virtual server. But in BIG-IP AWAF.. we config it as 1 virtual server 100 application (multi domain vip+use irule to check host header and send it to specific pool and choose specific waf policy) So we can't see each application metric in BIG-IQ.... This is our issue. I understand we need to config each vip for each application so BIG-IQ can retrive data from each vip per application but we can't use that many public ip. So I found that we have irule "virtual" which can send traffic to another virtual server. Can we do it like this? Instead of when HTTP_REQUEST { if {[HTTP::host] equals "abc.example.com"} { ASM::enable /Common/abc.example.com >>>> choose pool and waf policy by host header pool /External/Pool_abc.example.com } ------------------------------------ Change to when HTTP_REQUEST { if {[HTTP::host] equals "abc.example.com"} { virtual VS_abc.example.com >>> send it to private ip virtual server by host header which craete a new. } and in virtual server VS_abc.example.com we use private ip and assign pool and waf policy normally so we can add VS_abc.example.com in BIG-IQ application dashboard and see metric per application. But is there any limitation on how to use irule "virtual" like this? Is this practical?736Views1like3CommentsMigrating two physical devices to one virtual appliance
There are two separate standalone physical devices, one with LTM APM ASM and another one with LTM and GTM(DNS). Both the devices with huge configurations. Please let me know what all options we have in order to migrate these two physical devices to one virtual appliance.432Views0likes0CommentsBIG-IP LTM VE virtual hardware upgrade: Migrate to new virtual appliance or upgrade in place?
We have 2 instances of BIG-IP LTM VE deployed in separate environments and both were deployed to their respective vSphere environments several years ago and are still running at VMware HW Version 7, though the BIG-IP LTM versions running on them are currently 14.1.6. We have been upgrading them by ISO files (standard software upgrade procedure) without changing the VMs' configurations or virtual hardware versions. We have since upgraded our vSphere environments to 6.7 U3, and we plan to upgrade the BIG-IP LTM VE appliances we have to version 15.1.x from 14.1.x (and later, our physical F5 BIG-IP nodes from 13.1.x to 15.1.x). What is the best approach or path to upgrading both the virtual hardware and software versions running on them? Do I just upgrade the virtual HW in place to the latest available, or is it better/easier to deploy the 15.1.x VE OVA and just backup/copy/migrate the configs (UCS..?) over to the new appliance? If upgrading HW in place, does the VM need to be powered off? I want the most stable upgrade method possible, since the HW upgrade is a big jump up, especially when also upgrading a major OS version. Note, we can easily power the virtual F5 appliances down as these are in test environments.589Views0likes0CommentsSSL issue
Hello there, We have a F5 LTM and a virtual server configured to a server in port 443, the topology is: Computer --> F5 LTM --> switch --> server When we try to connect to the server through https we saw the message "Connection reset" in the browser, but if we try to connect without passing the F5 the connection is successful. We don't have configured any SSL client profile or server. This is the configuration on F5: #Virtual Server #________________________________________________________________________________ ltm virtual /Common/Server1 { destination /Common/10.1.5.X:443 ip-protocol tcp mask 255.255.255.255 pool /Common/Server1 profiles { /Common/tcp { } } source 0.0.0.0/0 translate-address enabled translate-port enabled } #________________________________________________________________________________ #Pools #________________________________________________________________________________ ltm pool /Common/Server1 { members { /Common/10.1.7.X:443 { address 10.1.7.X } } monitor /Common/https_443 } #________________________________________________________________________________ #Profiles #________________________________________________________________________________ # -Default Profile- ltm profile tcp tcp { ack-on-push enabled close-wait-timeout 5 congestion-control high-speed deferred-accept disabled delayed-acks enabled ecn disabled fin-wait-timeout 5 idle-timeout 300 keep-alive-interval 1800 limited-transmit enabled max-retrans 8 nagle disabled proxy-buffer-high 49152 proxy-buffer-low 32768 proxy-mss disabled proxy-options disabled receive-window-size 65535 reset-on-timeout enabled selective-acks enabled send-buffer-size 65535 slow-start enabled syn-max-retrans 3 time-wait-recycle enabled time-wait-timeout 2000 timestamps enabled } As you can see, we don't have any SSL client or server profile and we tried changing "translate-port" to disabled and "Source Address Translation" to auto map but none of these work. Also we made a tcpdump and we can see the TCP Reset from 10.1.7.X (tcpdump.png) and some curl (curl.png), openssl (openssl.png and openssl2.png) and a telnet (telnet.png). Hope you can help us to find out what's going on. Thank you.422Views1like1Comment