2021.09.05 – Delete all Cloud Resources In AWS

Note 2021.09.20: Mistake! I delete manually also default thinks and I had to search a create again!!

Note: Delete all Cloud Resources In AWS if you are using to learn. Not in Productivity!!

Method 1. Nuke Your AWS Cloud 

Combination of articles that helped to try to delete all content in AWS:

Do all needed in MacBook and run Nuke:

1. Ensure that you have aws configure configured in MacBook

1.a. Download and install it using Homebrew 

silvia ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

   !!! Xcode is included in this installation

1.b. Install wget

silvia ~ % brew install wget

2. Run cloud-nuke

silvia ~ % sudo cloud-nuke aws
Password:
INFO[2021-09-04T17:39:38+03:00] The following resource types will be nuked:  
INFO[2021-09-04T17:39:38+03:00] - ami                                        
INFO[2021-09-04T17:39:38+03:00] - asg
……
/usr/local/go/src/runtime/asm_amd64.s:1357 (0x1059fe1)
  error="Encountered multiple errors:\nAccessDenied: Access Denied\n\tstatus code: 403, request id: 66C2V18BQM63MVBT, host id: sBZQSh5SGutqXr7GNqZuaEb89CtHLKOFGBmBt0y5ApeT6vAl9bvjNAio0sr9Nr6i5+4r9XziZtc="
silvia ~ % 

3. Searching and finding problem in IAM Roles:

3.a. Errors during deleting roles.

  • Role AWSServiceRoleForConfig not deleted.
  • One or more ConfigurationRecorders are using this role.

3.b. Errors during deleting roles.

  • Role AWSServiceRoleForOrganizations not deleted.
  • You can’t remove the service-linked role from accounts in an organization with All Features enabled.

3.c. Errors during deleting roles.

  • Role AWSServiceRoleForSSO not deleted.
  • There is an SSO instance with master account 317942813033, Please delete the SSO instance first before requesting to delete the SLR.

4. MAYBE the problem is because connection to AWS through CLI was based on user key access not the root. Next I try to connect from MacBook to AWS using root access.

5. Search to run again cloud-nuke in root

  • 5.a.  Managed to delete S3, deleting first policy for this S3
  • 5.b. Run again sudo cloud-nuke aws
  • 5.c. No problem, maybe delete completely base on this process

6. Run again sudo cloud-nuke aws (Connected to CLI based on root Key Access)

…
INFO[2021-09-05T05:55:22+03:00] Checking region [14/17]: us-east-1           
INFO[2021-09-05T05:55:29+03:00] Checking region [15/17]: us-east-2           
INFO[2021-09-05T05:55:35+03:00] Checking region [16/17]: us-west-1           
INFO[2021-09-05T05:55:42+03:00] Checking region [17/17]: us-west-2  
INFO[2021-09-05T05:55:51+03:00] Nothing to nuke, you're all good!            
silvia ~ % 

7. Not all things deleted in AWS. IAM Roles still there included things explain for error!!!

Method 2. Delete things remained in AWS Cloud 

8. IAM Roles problem to delete => are still there

8.a. Errors during deleting roles.

  • Role AWSServiceRoleForConfig not deleted.
  • One or more ConfigurationRecorders are using this role.

8.a.1. To delete the configuration recorder

silvia ~ % aws configservice delete-configuration-recorder --configuration-recorder-name default

8.a.2. Delete role successfully.

Role deleted AWSServiceRoleForConfig

8.b. Errors during deleting roles.

  • Role AWSServiceRoleForOrganizations not deleted.
  • You can’t remove the service-linked role from accounts in an organization with All Features enabled.

8.b.1. To remove the management account from an organization and delete the organization

  1. Sign in to the AWS Organizations console. You must sign in as an IAM user, assume an IAM role, or sign in as the root user (not recommended) in the organization’s management account.
  2. Before you can delete the organization, you must first remove all accounts from the organization. For more information, see Removing a member account from your organization.
  3. Navigate to the Settings page, and then choose Delete organization.
  4. In the Delete organization confirmation dialog box, enter the organization’s ID which is displayed in the line above the text box. Then, choose Delete organization.
  5. (Optional) If you also want to close the management account, you can follow the steps at Closing an AWS account.

Source: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_delete.html

8.c. Errors during deleting roles.

  • Role AWSServiceRoleForSSO not deleted.
  • There is an SSO instance with master account 317942813033, Please delete the SSO instance first before requesting to delete the SLR.

8.c.1. Find info and delete SSO: https://aws.amazon.com/blogs/security/how-to-delegate-management-of-identity-in-aws-single-sign-on/

8.c.2. Delete Roles Successfully.

I hope is all deleted!!!

Note 2021.09.20: Mistake! I delete also default thinks and I had to search a create again!!

Posted in AWS

2021.06.21 – Voice Message in Message Apps

I use differ Message Apps in iPhone and MacBook Pro: WhatsApp, Skype and FaceBook.

1.WhatsApp

1.1. Create and Send voice Messages
How to send voice messages?
https://faq.whatsapp.com/android/chats/how-to-send-voice-messages/?lang=en

1.2. Listening faster the received Voice Message
Fast Playback for voice messages?
https://indianexpress.com/article/technology/social/whatsapp-fast-playback-for-voice-messages-what-it-is-and-how-to-use-it-7346534/

2. Skype app similar to WhahApp
3. Facebook Messager similar to WhatApp

2021.04.30 – Install CentOS.ova in VMware Fusion

This example is for:

  • MacBook Pro
  • Vmware Fusion Profesional 12.1.1
  • CentOS.ove
  1. Install CentOS.ove in VMware Fusion 

1.1. Download CentOS.7z.001 – CentOS.7z.004 

Note: Can be more or less files but here is an example of 4 files

1.2. Install and use Keka app to connect CentOS.7z.001 – CentOS.7z.004 and create CentOS.ova file

1.3. Import CentOS.ova in Vmware Fusion:

Select File > Import.

  • Click Choose file and browse to the .ovf or .ova file and click Open.
  • Type the name for the imported virtual machine in the Save As text box and indicate where to save it. The default destination is the Virtual Machines folder created by Fusion. 
  • Click Save. Fusion performs OVF or OVA specification conformance and virtual hardware compliance checks. A status bar indicates the progress of the import process. 

Note: The example is from Vmware docs –  https://docs.vmware.com/en/VMware-Fusion/12/com.vmware.fusion.using.doc/GUID-275EF202-CF74-43BF-

  • Click VMware Fusion > Virtual Machine > Settings > Advanced: activate Disable Side Channel Mitigations
  • Click VMware Fusion > Virtual Machine > Start Up
  • CentOS content: User: _visible_ and Password: _necesary_to_know_
  • Verify networks in CentOS > Terminal: 
$ ip add show 
=> Example: eth0 down, eth1 172.25.11.254/24, eth2 10.0.11.2/24 and 10.0.11.3/24
  • Take notes to be sure you will not forget for next steps
  • VMware Fusion > Virtual Machine > Shows Down
  1. Create/modify VMware Fusion Networks:
  • Open Terminal in MacBook Pro 
  • Open VMware network file: 
% sudo vim /Library/Preferences/VMware\ Fusion/networking
  • Modify! You can also use V in view mode to launch “VISUAL LINE” mode. Select your lines and type d to delete them.
  • Exemple of what I use
VERSION=1,0
 answer VNET_1_DHCP yes
 answer VNET_1_DHCP_CFG_HASH BC1AB29239D0B41CB64A4C11F3DE544B36D778A2
 answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_1_HOSTONLY_SUBNET 192.168.120.0
 answer VNET_1_VIRTUAL_ADAPTER yes
 answer VNET_8_DHCP yes
 answer VNET_8_DHCP_CFG_HASH 96CB1EC54E103210F4A187D6355843A795323CCC
 answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_8_HOSTONLY_SUBNET 192.168.100.0
 answer VNET_8_NAT yes
 answer VNET_8_VIRTUAL_ADAPTER yes
 …
 answer VNET_93_DHCP no
 answer VNET_93_DISPLAY_NAME eth1
 answer VNET_93_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_93_HOSTONLY_SUBNET 172.25.11.0
 answer VNET_93_NAT yes
 answer VNET_93_NAT_PARAM_UDP_TIMEOUT 30
 answer VNET_93_VIRTUAL_ADAPTER yes
 answer VNET_94_DHCP no
 answer VNET_94_DISPLAY_NAME eth2
 answer VNET_94_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_94_HOSTONLY_SUBNET 10.0.11.0
 answer VNET_94_NAT yes
 answer VNET_94_NAT_PARAM_UDP_TIMEOUT 30
 answer VNET_94_VIRTUAL_ADAPTER yes
 …
  • Quit VMware Fusion networking file
  • Open VMware Fusion app
  • Click VMware Fusion > Preferences > Network
  • Untagged Request authentication to enter promiscuous mode 
  • Click the lock to make changes
  • Activate Allow virtual machine on the network to connect to external networks (using NAT)
  • Quit VMware Fusion app
  • Open VMware Fusion app again
  1. Configure CentOS VM network in VMware Fusion app
  • Open VMware Fusion app
  • Click Virtual Machine > CentOS
  • Click Virtual Machine > Settings… 
  • — Network Adapter > Autodetect (is for eth0)
  • — Network Adapter 2 > eth1
  • — Network Adapter 3 > eth2 _to_ge-0/0/0

Note: To create and use Networks: http://tech.silvique.ro/2021/04/29/2021-04-29-create-vmware-fusion-networks/

  • Click Virtual Machine > Start Up
  1. Verify CentOS VM network inside CentOS
  • Open Terminal in CentOS and use different commands to verify
 $ ifconfig
 — eth1 172.25.11.254
 — eth2:8012 10.0.11.2/24 
 — eth2:8013 10.0.11.3/24
$ ping 10.0.11.1
$ ping 10.0.11.2
$ ping 10.0.11.3
$ ping 172.25.11.254
$ ping 172.25.11.1 

If necessary, modify network connectivity in Vmware Fusion.

Good Luck!!

2021.04.29 – Create VMware Fusion Networks

This example is for:

  • MacBook PRO
  • VMware Fusion PRO
  • Terminal app

To do:

  • Quit VMware Fusion
  • Open Terminal app
  • Insert command:
MacBook-Pro ~ % sudo vim /Library/Preferences/VMware\ Fusion/networking
Password: *****
  • Edit networking as you need. Here is an example:
VERSION=1,0
 answer VNET_1_DHCP yes
 answer VNET_1_DHCP_CFG_HASH 94FBD644B069B37AC268E3AF0B92BED6229C9EAE
 answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_1_HOSTONLY_SUBNET 192.168.120.0
 answer VNET_1_VIRTUAL_ADAPTER yes
 answer VNET_8_DHCP yes
 answer VNET_8_DHCP_CFG_HASH 31A6A65AD36EBF281BD56B02C4F21576E1F247D6
 answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_8_HOSTONLY_SUBNET 192.168.100.0
 answer VNET_8_NAT yes
 answer VNET_8_VIRTUAL_ADAPTER yes
 answer VNET_90_DHCP no
 answer VNET_90_DISPLAY_NAME ge-0/0/0
 answer VNET_90_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_90_HOSTONLY_SUBNET 172.17.90.0
 answer VNET_90_VIRTUAL_ADAPTER yes
 answer VNET_91_DHCP no
 answer VNET_91_DISPLAY_NAME ge-0/0/1
 answer VNET_91_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_91_HOSTONLY_SUBNET 172.17.91.0
 answer VNET_91_VIRTUAL_ADAPTER yes
 answer VNET_93_DHCP no
 answer VNET_93_DISPLAY_NAME eth1
 answer VNET_93_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_93_HOSTONLY_SUBNET 172.25.11.0
 answer VNET_93_NAT yes
 answer VNET_93_NAT_PARAM_UDP_TIMEOUT 30
 answer VNET_93_VIRTUAL_ADAPTER yes
 answer VNET_94_DHCP no
 answer VNET_94_DISPLAY_NAME eth2_to_ge-0/0/0
 answer VNET_94_HOSTONLY_NETMASK 255.255.255.0
 answer VNET_94_HOSTONLY_SUBNET 10.0.11.0
 answer VNET_94_NAT yes
 answer VNET_94_NAT_PARAM_UDP_TIMEOUT 30
 answer VNET_94_VIRTUAL_ADAPTER yes
  • To delete you can use V in view mode to launch “VISUAL LINE” mode. Select your lines and type d to delete them.
  • Add the networks you need.
  • Save and exit: :wq
  • Open Vmware Fusion and use the created networks. 

Good luck!!

2021.02.7 – Install vQFX 20.2 in ESXi 6.7.0 – maybe problem!

Idea 1. Download vQFX devices needed to install in ESXi  6.7.0:

  • -> vqfx-20.2R1-2019010209-pfe-virtualbox.box
  • -> vqfx-20.2R1.10-re-virtualbox.box

Idea 2. Searc on internet solutions:

2.1. https://andrewroderos.com/deploying-vqfx-on-vmware-esxi/ – this article has many good details. But I had problems …

2.2. https://dave.dev/blog/2018/06/juniper-vqfx10k-esxi-6-5/ – here are not many-many details and steps as I need to understand and use but I in this article discovered a solution to understand and use what I need: Existing hard drive in New virtual machine – 4 Customise settings – Add hard disk – Existing hard drive. Also I use Compatibility – ESXi 5.5 virtual machine. because ESXi 6.5 does not work for me …

Idea 3. Use 2.1. article to learn how to Searc and discover what you need for your version of vQFX switch:

[root@ESXi-1:/vmfs/volumes/601ee96f-4e5130e8-529f-000c29943590/vQFX-1-PFE] cat 13607462130/box.ovf | grep -E '(CPU|memory|OSType)'
       <vbox:OSType ovf:required="false">Linux26_64</vbox:OSType>
         <rasd:Caption>2 virtual CPU</rasd:Caption>
         <rasd:Description>Number of virtual CPUs</rasd:Description>
         <rasd:ElementName>2 virtual CPU</rasd:ElementName>
         <rasd:Caption>2048 MB of memory</rasd:Caption>
         <rasd:ElementName>2048 MB of memory</rasd:ElementName>
     <vbox:Machine ovf:required="false" version="1.16-linux" uuid="{a95a8790-b9d8-4df2-b025-2bcac3a6175a}" name="vqfx-2019010209-pfe-virtualbox" OSType="Linux26_64" snapshotFolder="Snapshots" lastStateChange="2020-01-15T01:00:49Z">
         <CPU count="2">
         </CPU>
 

 [root@ESXi-1:/vmfs/volumes/601ee96f-4e5130e8-529f-000c29943590/vQFX-1-RE/13717072731] cat box.ovf | grep -E '(CPU|memory|OSType)'
       <vbox:OSType ovf:required="false">FreeBSD</vbox:OSType>
         <rasd:Caption>1 virtual CPU</rasd:Caption>
         <rasd:Description>Number of virtual CPUs</rasd:Description>
         <rasd:ElementName>1 virtual CPU</rasd:ElementName>
         <rasd:Caption>1024 MB of memory</rasd:Caption>
         <rasd:ElementName>1024 MB of memory</rasd:ElementName>
     <vbox:Machine ovf:required="false" version="1.15-linux" uuid="{5a9930a0-1cba-4fd2-8a5b-c97c8af50f11}" name="packer-virtualbox-ovf-1597797396" OSType="FreeBSD" snapshotFolder="Snapshots" lastStateChange="2020-08-19T00:43:50Z">
         <CPU>
         </CPU>
 

Note: I install in MacBook Pro – VMware Fusion – ESXi … maybe this made me to search a different solution …

But I have different problems now!!

Here are pictures with a solution and a new problem: https://photos.app.goo.gl/4icHYiRueFnKkWr1A

2021.02.7 – Adding ESXi Hosts to a Cluster in vCenter Server

My application photos: https://photos.app.goo.gl/D8geSqKgmaqULPpS6

  • I use because I need to delete full 2 VMs from ESXi. In mine photos are included the delete …
  • I do not knpw how to delete full directly in ESXi. And I also is a reason to learn vCenter.

Good luck!

2020.10.24 – Juniper vMX 20.2 installation in EVE-PRO

Very useful: https://www.eve-ng.net/index.php/documentation/howtos/howto-add-juniper-vmx-16-x-17-x/

This guide is based on version:

  • EVE images name, vCPUs and vRAM
    • vmxvcp-20.2R1.10-domestic-VCP, 1 vCPU, 2 Gb vRAM
    • vmxvfp-20.2R1.10-domestic-VFP, 3 vCPUs, 4 Gb vRAM
  • Downloaded Filename
    • vmx-bundle-20.2R1.10.tar
  • Version
    • Junos: 20.2R1.10

The Juniper vMX images are based on dual nodes setup, where Routing Engine (VCP) is connected to Forwarding Plane (VFP) and act like single node. All cli configurations will be done on the VCP, but porting and connections will be on VFP.

Step 1. Create temporary working directory for image:

root@eve-ng:/opt/unetlab/addons/qemu# mkdir vMX

Step 2. Upload the downloaded images to the EVE using for example FileZilla (or WinSCP). 

root@eve-ng:/opt/unetlab/addons/qemu/vMX# ls
vmx-bundle-20.2R1.10.tar

Step 3. Uncompress images:

root@eve-ng:/opt/unetlab/addons/qemu/vMX# tar xvf vmx-bundle-20.2R1.10.tar

root@eve-ng:/opt/unetlab/addons/qemu/vMX# cd vmx-limited/images/

root@eve-ng:/opt/unetlab/addons/qemu/vMX2/vmx/images# ls
junos-vmx-x86-64-20.2R1.10.qcow2  metadata-usb-fpc4.img  metadata-usb-re1.img
junos-vmx-x86-64-20.2R1.10.tgz    metadata-usb-fpc5.img  metadata-usb-service-pic-10g.img
metadata-usb-fpc0.img                     metadata-usb-fpc6.img  metadata-usb-service-pic-2g.img
metadata-usb-fpc1.img                     metadata-usb-fpc7.img  metadata-usb-service-pic-4g.img
metadata-usb-fpc10.img                    metadata-usb-fpc8.img  vFPC-20200213.img
metadata-usb-fpc11.img                    metadata-usb-fpc9.img  vmxhdd.img
metadata-usb-fpc2.img                     metadata-usb-re.img
metadata-usb-fpc3.img                     metadata-usb-re0.img

Step 4. Create VCP image folder:

root@eve-ng:/opt/unetlab/addons/qemu/vMX/vmx/images# mkdir /opt/unetlab/addons/qemu/vmxvcp-20.2R1.10-domestic-VCP

Step 5. Copy images to VCP image folder:

 Step 5.1. virtioa.qcow2

root@eve-ng:/opt/unetlab/addons/qemu/vMX/vmx/images# cp junos-vmx-x86-64-20.2R1.10.qcow2 /opt/unetlab/addons/qemu/vmxvcp-limited-20.2R1.10-domestic-VCP/virtioa.qcow2

 Step 5.2. virtiob.qcow2

root@eve-ng:/opt/unetlab/addons/qemu/vMX/vmx/images# cp vmxhdd.img /opt/unetlab/addons/qemu/vmxvcp-20.2R1.10-domestic-VCP/virtiob.qcow2

 Step 5.3. virtioc.qcow2

root@eve-ng:/opt/unetlab/addons/qemu/vMX/vmx/images# cp metadata-usb-re.img /opt/unetlab/addons/qemu/vmxvcp-20.2R1.10-domestic-VCP/virtioc.qcow2

Check all

root@eve-ng:/opt/unetlab/addons/qemu/vMX/vmx/images# ls /opt/unetlab/addons/qemu/vmxvcp-20.2R1.10-domestic-VCP
virtioa.qcow2  virtiob.qcow2  virtioc.qcow2

Step 6. Create VFP image folder:

root@eve-ng:/opt/unetlab/addons/qemu# mkdir /opt/unetlab/addons/qemu/vmxvfp-20.2R1.10-domestic-VFP

Step 7. Copy images to VFP image folder:

 Step 7.1. virtioa.qcow2

root@eve-ng:/opt/unetlab/addons/qemu/vMX/vmx/images# cp vFPC-20200819.img /opt/unetlab/addons/qemu/vmxvfp-20.2R1.10-domestic-VFP/virtioa.qcow2

Step 8. Fix permissions:

root@eve-ng:/opt/unetlab/addons/qemu# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions


Apr 24 15:05:36 Apr 24 15:05:36 Online Check state: Valid

Add VCP and VFP nodes on the topology and connect them with int interfaces. int interface is communication port between VCP and VFP. This setup will be one vMX node (set of 2). Use VFP to connect your lab element to the ports.

Topology testing: