Understand Preemptible and Spot Virtual Machine in Google Cloud Platform

Understand Preemptible and Spot Virtual Machine in Google Cloud Platform

If you're looking for a cost-effective way to run your workloads on Google Cloud Platform, you may want to consider using preemptible or spot VMs. Preemptible VMs can be interrupted by Google with only short notice, so they're ideal for workloads that can tolerate interruptions. Spot VMs are offered at a discount compared to on-demand VMs, so they're a great option if you're budget-conscious. In this post, I will dive into what preemptible and spot VMs are and how they can benefit your organization.

Note – Please bookmark this below page to access all posts regarding Google Cloud Digital Leader certification.

Google Cloud Digital Leader Certification Notes

Read this blog post or watch the video below to learn how to create Preemptible and Spot Virtual Machine in the Google Cloud Platform.

What Is Preemptible Virtual Machine

Preemptible VMs in Google Cloud Platform (GCP) offers a cost-effective option for workloads that are able to tolerate the possibility of being interrupted. These VMs are typically available at a discount of up to 80% compared to standard on-demand instances, making them an attractive choice for cost-conscious organizations. 

Preemptible VMs are short-lived compute instances that are available at a lower price than standard on-demand instances. They are designed for workloads that are able to tolerate being interrupted and can be terminated by GCP at any time. Preemptible VMs are an ideal choice for batch processing jobs, data processing, and other types of workloads that are not time-sensitive.

One important thing to note is that preemptible VMs are not suitable for all workloads. They should not be used for applications that require a high level of availability or for workloads that are sensitive to data loss. Additionally, preemptible VMs are not eligible for the GCP Service Level Agreement (SLA), so it is important to consider the potential impact of an interruption before using them.

How To Save Costs With Preemptible Virtual Machine

Preemptible VMs can help you save costs in GCP in several ways:

  1. Discounted pricing: As mentioned earlier, preemptible VMs are available at a discount of up to 80% compared to standard on-demand instances. This can significantly reduce your compute costs in GCP.
  2. Flexibility: Preemptible VMs can be terminated at any time, which allows you to scale your compute capacity up and down as needed. This flexibility can help you avoid overprovisioning and save on costs.
  3. Batch processing: Preemptible VMs are well-suited for batch processing jobs, which can help you save on costs by allowing you to process large amounts of data in parallel.
  4. Spot instances: Preemptible VMs are similar to Amazon Web Services' (AWS) spot instances, which allow you to bid on spare compute capacity. If the price you bid is higher than the current spot price, your preemptible VMs will be created and run until either your specified maximum price is reached or the VMs are terminated by GCP.

Tips For Using Preemptible Virtual Machine

Here are a few tips for using preemptible VMs effectively:

  1. Use preemptible VMs for workloads that can tolerate being interrupted: As mentioned earlier, preemptible VMs should not be used for workloads that require a high level of availability or are sensitive to data loss.
  2. Use fault tolerance techniques: To ensure that your workloads can recover from an interruption, you should consider using fault tolerance techniques such as replicating your data or using a tool like Google Cloud's Managed Instance Group (MIG) to automatically recreate your VMs if they are terminated.
  3. Use automation: To take full advantage of preemptible VMs, you should consider using automation to scale your compute capacity up and down based on demand. This can help you take advantage of the discounted pricing and ensure that you are only paying for the compute resources you need.

Things To Remember While Using Preemptible Virtual Machine

There are couple of things you should remember while using Preemptible Virtual Machine and they are -

  1. It is a short-lived and cheaper virtual machine. It can run only for 24 hours.
  2. Google Cloud Platform can stop the instance any point of time and you will get only 30 seconds of warning before closure so that you can save your work.
  3. There are some restrictions associated -
    1. Preemptible Virtual Machines are not always available.
    2. You can not use Google Tier Free Credit to create this virtual machine.
    3. No automatic restarts are available.
    4. These virtual machines are not covered by any Service Level Agreement and are excluded from the Compute Engine SLA. 

What Is Spot Virtual Machine

Google Cloud Platform (GCP) offers a variety of services for running virtual machines (VMs) in the cloud, including the ability to create and manage Spot VMs.

Spot VMs are a cost-effective option for running workloads that can tolerate interruptions. They are available at a significant discount compared to on-demand VMs, and are ideal for batch jobs, big data processing, and other workloads that can be interrupted without loss of data.

Spot VMs are created using the same process as on-demand VMs, with the added option to specify a maximum bid price. This bid price is the most you are willing to pay for the Spot VM, and it will be terminated if the spot price exceeds this bid price.

One of the key benefits of Spot VMs is that they allow you to take advantage of spare capacity in the GCP infrastructure, resulting in cost savings of up to 90% compared to on-demand VMs. This is because the Spot market price fluctuates based on supply and demand, and when the demand for Spot VMs is low, the price drops, allowing you to get the same resources at a lower cost.

Additionally, Spot VMs offer a high level of flexibility and scalability, as you can easily scale your workloads up or down as needed. You can also use GCP's autoscaling feature to automatically scale your Spot VM instances based on your workload needs.

Spot VMs can be managed through the GCP Console, the gcloud command-line tool, or through the GCP API. Additionally, GCP provides several pre-configured images for running popular workloads, such as Apache Hadoop and Apache Spark, on Spot VMs.

What Is The Difference Between Spot & Preemptible Virtual Machine

Spot Virtual Machines are the latest version of Preemptible Virtual Machines. However, Spot Virtual Machines provide new features that Preemptible Virtual Machines do not support.

Unlike Preemptible Virtual Machine, Sport Virtual Machine doesn't have any runtime restrictions like 24 hours. It can run any number of hours.

Rest all features are same.

To create a Preemptible Virtual Machine, you need to use either gcloud CLI or Compute Engine API. But you can create Spot Virtual Machine from Google Cloud Console.

Steps To Create Spot Virtual Machine

To create Spot Virtual Machine, first, you need to go to Compute Engine -> VM instances. From there, you need to click on "Create Instance" button.

In the next screen, expand the Advanced options and then expand the Management section. You will find the option Spot under VM provisioning model. Below is the screenshot

Conclusion

In conclusion, Preemptible VMs and Spot VMs both provide cost-saving advantages for GCP users. Preemptible VMs are best suited for non-time-sensitive workloads that can take advantage of their lower per-hour cost. Spot VMs provide a cost-effective option for running workloads that can tolerate interruptions without impacting your performance or end-user experience. By understanding when to use these options, you can get the most out of GCP and save time and money in the process. Are you ready to reap the benefits of Preemptible and Spot VMs? Start exploring today!

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

How to Create Custom Image in Google Cloud Platform

How to Create Custom Image in Google Cloud Platform

We will learn how to generate a custom Image on Google Compute Engine in this article. You can import a boot disc image called a "custom image" from your on-premises environment or another cloud platform to Compute Engine. This blog post will walk you through each step of creating a custom image in Google Compute Engine on the Google Cloud Platform.

Let's get started and learn more about custom images in this article. Keep checking back here as I continue to produce several articles on Google Cloud.

Note – Please bookmark this below page to access all posts regarding Google Cloud Digital Leader certification.

Google Cloud Digital Leader Certification Notes

Read this blog post or watch the video below to learn how to create Custom Images in Google Cloud Platform.

What Is Custom Image

Utilizing a custom image will speed up the installation of software and OS patches during the launch of VM instances. Therefore, it takes a long time to run a virtual machine instance whenever you build one and install a lot of applications or OS patches. The ideal strategy is to generate a custom image with OS patches and apps pre-installed in order to skip the above process. You may therefore use that custom image to generate one or more instances by doing this. You can actually create a custom image in Google Cloud using a variety of tools, including instances, persistent discs, snapshots, and cloud storage. Once the custom image has been developed, it is possible to share it across projects.
The ability to deprecate all images is another capability offered by Google Cloud. Therefore, you always have the choice to mark an image as deprecated if it has been around for a while.

Create Custom Image

Creating a Custom Image in the Google Cloud Platform needs a couple of steps. So in this blog post, I am going to share all the steps you need to perform and here are they -

Pre-requisite

Let's say I have this Virtual Machine (screenshot below) which is already having an Apache server installed. Every Virtual Machine runs on a disk. So I will be using this disk to create the image.

Create An Image

To create an image from a disk, the first thing you need to do is stop the Virtual Machine this is linked to this image. It is not required, but it is a kind of best practice to always stop the virtual machine before using the associated disk to create custom image.

Hard discs, sometimes known as discs, are what your virtual computers are connected to. The operating system of the virtual machine operates on the hard disc that is connected to the specific VM whenever you build one.

Therefore, I will select the Create Image option from the Action menu in order to make a duplicate of this particular disc.

Once I click on the Create image, I will see the image creation menu in the below screen. Here, I will give the image name.

I want to change the location to Multi-Regional as I want my virtual machines to run in multiple regions.

Once I create the image, I can find my custom image under Storage -> Images section.

Create An Instance Template From The Image

After creating an image I will click on the Instance template from the left navigation menu and select the instance template. Here, I will click on "Create Instance Template". I will give it a name. But most important thing is to change the Boot Disk and select the custom image I have just created.  

This way, I can change the standard boot disk and use my custom image. Now this custom image is already having an apache server installed and configured. So any virtual machine I will create from this new instance template, I don't need to install an apache server and configure it. The only thing that I need to do is to start the apache server. And I can do this by writing startup scripts.

Configure The Startup Script

On this same page, I will click on "Advanced Options" and expand the "Management" section to write the startup script, which will configure and start the apache server on every virtual machine that I will create from this instance template.

Create A New Virual Machine From Instance Template

This time I will create a new Virtual Machine from this Instance Template and test it. I have a dedicated blog and youtube video where I covered how to create Virtual Machine from Instance Template. The links are given below -

Below is the new Virtual Machine created from Instance Template.

Now when I click on the External IP, I can see the custom message coming from index.html which is configured in the apache server. And the important point is that I don't need to do any configuration like installing the apache server, updating the index.html page, etc. All the configurations are stored in the custom image and I literally used that image to create the template and finally virtual machine from there.

Conclusion

Because I don't have to wait for the package to install before the VM starts, utilizing a custom image has the advantage of making boot time a little bit quicker. So now you also know how to make a unique custom image and use that image to make a virtual machine using an instance template.

I'm hoping that this article may assist you in using Google Compute Engine to create a custom image. I will publish many more articles on Google Cloud in the upcoming blog. 

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

How Salesforce & Google Cloud handles Denial of Service (“DoS”) attack

How Salesforce & Google Cloud handles Denial of Service (“DoS”) attack

Denial of Service (DoS) attacks are a common and serious threat to the availability of online services. These attacks are designed to overwhelm a targeted server or network with a flood of traffic, making it impossible for legitimate users to access the service. In this blog post, I will discuss the various types of DoS attacks, the methods used to protect against them, and best practices for protecting your online services from these attacks.

Distributed Denial of Service (DDoS)

One of the most common types of DoS attacks is a Distributed Denial of Service (DDoS) attack. DDoS attacks are launched from multiple sources, making them much more difficult to detect and defend against. These attacks can be launched using a variety of methods, including botnets, amplification attacks, and application-layer attacks.

Ways To Protect Against DDoS Attacks

One of the most effective ways to protect against DDoS attacks is to use a Content Delivery Network (CDN). A CDN is a network of servers that are distributed across multiple locations, and it is designed to distribute traffic evenly across the network. This helps to ensure that even if one server is overwhelmed by a DDoS attack, the traffic will be distributed to other servers in the network, keeping the service available to legitimate users.

Another effective method for protecting against DDoS attacks is to use a firewall. A firewall is a device or software that is designed to block unwanted traffic. Firewalls can be configured to block traffic based on various criteria, such as IP address, port, or protocol. This helps to ensure that only legitimate traffic is able to reach the targeted server or network.

Another important aspect of DoS protection is to monitor your network and servers. This includes monitoring for unusual traffic patterns, such as a sudden increase in traffic from a specific IP address or a spike in traffic to a specific port. This can help you to detect a DoS attack early and take action to mitigate it.

How Salesforce Handles DoS Attack

Salesforce's cloud platform, Salesforce Lightning Platform, uses a combination of network-level and application-level security measures to protect against Denial of Service (DoS) attacks.

At the network level, Salesforce's infrastructure includes multiple layers of security, such as firewalls, load balancers, and intrusion detection systems. These systems are designed to detect and block malicious traffic before it reaches the customer's resources.

At the application level, Salesforce uses its own custom-built web application firewall (WAF) to protect against common web-based attacks, such as SQL injection, cross-site scripting, and other types of injection attacks. This firewall uses machine learning algorithms to detect and block malicious traffic, which helps to prevent attacks from reaching the customer's resources.

Salesforce also provides customers with a variety of tools to help mitigate the impact of a DoS attack. For example, the platform allows customers to set up rate limiting and request queuing, which can help to prevent a single user from overwhelming the system with requests. Additionally, Salesforce's platform allows customers to set up Cloud Security controls, such as IP whitelisting and IP blocking, to further protect the customer's resources.

In addition to these technical measures, Salesforce also recommends best practices to protect against DoS attacks, such as regularly patching and updating software, monitoring network traffic for unusual patterns, and using strong authentication and access controls.

Overall, Salesforce's cloud platform provides a robust set of security features to protect against DoS attacks, including network-level security, application-level security, and additional tools to mitigate the impact of an attack. Additionally, Salesforce provides best practices recommendations to help customers further protect their resources.

How Google Cloud Handles DoS Attack

Google Cloud provides a variety of tools and services to help protect against Denial of Service (DoS) attacks. One of the key features is the Google Cloud Armor, a web application firewall that allows customers to create rules to block or allow traffic based on various criteria such as IP address, country, and request headers.

Additionally, Google Cloud Platform (GCP) offers built-in DDoS protection through its global network. This network is designed to automatically detect and mitigate DDoS attacks at the network layer, before they can reach the customer's resources. The network also uses machine learning algorithms to analyze traffic patterns, which helps to identify and block malicious traffic.

Google Cloud also provides a DDoS response service that allows customers to request assistance from Google's security experts to help mitigate a DDoS attack. The service includes 24/7 monitoring, incident response, and post-attack analysis.

Another feature that Google Cloud provides for DDoS protection is Cloud CDN (Content Delivery Network), which is a global network of caching servers that distribute content to users based on their geographic location. This helps to reduce the load on a customer's origin servers and improve the availability of the service.

In addition to these services, Google Cloud also recommends best practices for protecting against DDoS attacks, such as using strong authentication and access controls, regularly patching and updating software, and monitoring network traffic for unusual patterns.

Overall, Google Cloud provides a robust set of tools and services to help protect against DDoS attacks, including web application firewall, built-in DDoS protection, DDoS response service, Cloud CDN, and best practices recommendations.

Summary

Finally, it's important to have a response plan in place in case of a DoS attack. This plan should include procedures for identifying and mitigating the attack, as well as procedures for communicating with customers and stakeholders.

In conclusion, DoS attacks can have a serious impact on the availability of online services. To protect against these attacks, it's important to use a CDN, firewall, monitoring, and response plan. By implementing these measures, you can help to ensure that your online services remain available to legitimate users, even in the face of a DoS attack.

Disclaimer

This article is not endorsed by Salesforce or any other company in any way. I shared my knowledge on this topic in this blog post. Please refer to Salesforce Help for the latest information.

Comments

Simplify VM Creation in Google Cloud Platform With Instance Template

Simplify VM Creation in Google Cloud Platform With Instance Template

Google Cloud Platform (GCP) offers a variety of tools and options for creating virtual machines (VMs). One useful feature is Instance Templates, which allow you to save and reuse configurations for creating VMs. In this blog post, we will show you how to use Instance Templates to simplify the process of creating VMs in GCP.

Note – Please bookmark this below page to access all posts regarding Google Cloud Digital Leader certification.

Google Cloud Digital Leader Certification Notes

Read this blog post or watch the video below to learn how to simplify Virtual Machine creation with an Instance Template.

Creating an Instance Template

To create an Instance Template, first log in to the GCP console and navigate to the "Compute Engine" section. From the left menu, select "Instance Templates" under "Virtual Machines".

Next, click the "Create Instance Template" button. This will open a form where you can configure the various options for your template.

Here, you can specify the name and description of your template, as well as the machine type, boot disk, and any additional disks you want to include. You can also specify network and firewall settings, as well as any metadata or labels you want to apply to the template.

Once you have configured all of the options for your template, click the "Create" button to save it. Your new Instance Template will now appear in the list on the "Instance Templates" page.

Using an Instance Template to Create a VM

To use an Instance Template to create a VM, click the "Create Instance" button from the "Compute Engine" section of the GCP console. This will open a form similar to the one used to create an Instance Template.

Select the option "New VM Instance From Template" option from the left menu, which will show you all the templates that you can choose from.

Select the template and click on "Continue". The form will now be pre-populated with the options from your selected template. You can make any additional customizations as needed, and then click the "Create" button to create your VM. Your new VM will now be created using the configuration specified in your Instance Template. This can save you time and effort compared to manually configuring each VM individually.

Conclusion

Picking the right machine type, region, and zone for your template is essential for a successful long-term project. Different types of machines are better suited to different situations: from complex architectures that require a high level of processing power to instances tailored for storage of large amounts of data. Similarly, when selecting a region, factors like latency, cost, and regulatory compliance must be considered. Finally, choosing the appropriate zone within the selected region can give you additional throughput or lower latency depending on your requirements. Ultimately, taking the time to carefully select each component will make sure that you have set yourself up for success in your template venture.

After following the directions above, you should now have a google cloud virtual machine up and ready to use. Using Instance Templates can save you time and effort when creating multiple VMs in GCP, as you only need to specify the configuration once and can then use that configuration to create multiple VMs with just a few clicks.

Disclaimer

This article is not endorsed by Salesforce or any other company in any way. I shared my knowledge on this topic in this blog post. Please refer to Salesforce Help for the latest information.

Comments

Salesforce Flow Best Practices

Salesforce Flow Best Practices

Are you looking to get the most out of Salesforce Flow? If so, then you'll want to check out these best practices. From design tips to performance optimization, this blog post covers everything you need to know to make the most of Salesforce Flow. So whether you're a technical architect, administrator, or developer, be sure to read on for some valuable insights!

Salesforce Flow is a powerful tool that allows you to automate business processes, gather data, and create interactive experiences for your customers and employees. However, with great power comes great responsibility, and it's important to follow best practices to ensure that your Flow projects are efficient, reliable, and maintainable.

You can read -

Define Your Goal For The Flow - What Do You Want It To Accomplish?

Start by clearly defining the problem you are trying to solve. This will help you determine the scope of your Flow and ensure that you are building a solution that meets the needs of your business.

Create A Clear And Concise Flow Name That Describes It's Purpose

Crafting a flow name that accurately describes its purpose can be an especially daunting task. It needs to be succinct yet comprehensive, meaningful yet memorable. Achieving this balance requires a combination of creativity and clarity, both of which are essential for making sure that the intended message resonates with the desired audience without causing confusion or frustration along the way. Keeping keywords straightforward and avoiding overly complex phrasing ensures that everyone who reads it clearly understands it's purpose. With some time and effort, you can create a flow name that successfully communicates its mission while capturing the attention of your audience – making the journey easier for everyone involved.

Use Filters To Only Display Relevant Data To Users

In the age of big data, it can be overwhelming for users to find the information they are looking for in the vast sea of available data. By providing users with filters to narrow down the type of data they wish to view, it can significantly improve their user experience and help them get the most out of their data. Filters provide an efficient way to quickly sort through various datasets and only display the relevant findings while leaving irrelevant results behind. As a result, users are presented with important information without having to manually search through an entire database. This ultimately allows users to work smarter by quickly accessing what matters most and cutting down on wasted time.

You can use DataTable to display data which can be configured to do sorting and filtering.

Use Flow Elements Wisely

Flow elements are the building blocks of your Flow, and it's important to use them judiciously to avoid overloading your Flow with unnecessary complexity. For example, try to use a single Decision element instead of multiple Decision elements whenever possible.

Use Variables To Store Data

Variables allow you to store data within your Flow, which can be useful for storing intermediate results or passing data between different elements. Be sure to give your variables descriptive names so that it's clear what they are used for.

Test Your Flow Thoroughly

Before releasing your latest Flow creation, it is essential to test the functionality in a safe environment to ensure that the Flow works as intended and will not cause any unexpected problems. After all, you don't want your users wasting their time, encountering issues, or facing data corruption when using your Flow. An important part of testing can be generating disposable records such as dummy customer accounts or contacts and running through example scenarios with those records as if they were a real customer. Once you've tested all possible scenarios, signed off on the results and double-checked any reports or data integrations impacting other systems, your Flow should be ready to go live; bringing the great benefits automation can bring!

Add Error Handling To Your Flow

When building flows, it is important to add error-handling steps in order to anticipate any potential issues. This allows you to identify and manage errors quickly, without impacting other workflows or the output of the flow. By utilizing built-in or custom error handling techniques such as looping, debugging, process flows with exceptions, or logging messages, you can ensure an efficient resolution process and a smooth workflow process. Additionally, by monitoring your flows and their performance over time, you can detect any eventual problems at an early stage and fine-tune your flow accordingly. Error handling is an essential part of a successful flow and should not be disregarded.

Document Your Flow

Documentation is key to the maintainability of your Flow. Make sure to document any custom formulas or logic that you use in your Flow, as well as any assumptions or constraints that may impact its behavior.

Keep Your Flow Up-To-Date

Keeping your Flow up-to-date is paramount for staying informed and current with the latest productivity and collaboration trends. Regularly checking for updates and new features can help ensure that you have the latest tools to be able to stay connected and work efficiently. Staying up-to-date with the newest Flow releases will give you the freedom to focus your time on what matters most - getting things done.

Summary

Flows are an incredibly powerful tool that can automate many different processes within Power Apps. By following the tips in this blog post, you can create a Flow that is clear, concise, and easy to use. If you have any questions about creating or using Flows, please put them in the comment section– I will be more than happy to help!

Disclaimer

This article is not endorsed by Salesforce or any other company in any way. I shared my knowledge on this topic in this blog post. Please refer to Salesforce Help for the latest information.

Comments